ReplicationControllerSpec.fromJson constructor

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

Creates a ReplicationControllerSpec from JSON data.

Implementation

factory ReplicationControllerSpec.fromJson(Map<String, dynamic> json) {
  final tempMinReadySecondsJson = json['minReadySeconds'];
  final tempReplicasJson = json['replicas'];
  final tempSelectorJson = json['selector'];
  final tempTemplateJson = json['template'];

  final int? tempMinReadySeconds = tempMinReadySecondsJson;
  final int? tempReplicas = tempReplicasJson;

  final Map<String, String>? tempSelector = tempSelectorJson != null
      ? Map<String, String>.from(tempSelectorJson)
      : null;

  final PodTemplateSpec? tempTemplate = tempTemplateJson != null
      ? PodTemplateSpec.fromJson(tempTemplateJson)
      : null;

  return ReplicationControllerSpec(
    minReadySeconds: tempMinReadySeconds,
    replicas: tempReplicas,
    selector: tempSelector,
    template: tempTemplate,
  );
}