Toleration.fromJson constructor

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

Creates a Toleration from JSON data.

Implementation

factory Toleration.fromJson(Map<String, dynamic> json) {
  final tempEffectJson = json['effect'];
  final tempKeyJson = json['key'];
  final tempOperatorJson = json['operator'];
  final tempTolerationSecondsJson = json['tolerationSeconds'];
  final tempValueJson = json['value'];

  final String? tempEffect = tempEffectJson;
  final String? tempKey = tempKeyJson;
  final String? tempOperator = tempOperatorJson;
  final int? tempTolerationSeconds = tempTolerationSecondsJson;
  final String? tempValue = tempValueJson;

  return Toleration(
    effect: tempEffect,
    key: tempKey,
    operator: tempOperator,
    tolerationSeconds: tempTolerationSeconds,
    value: tempValue,
  );
}