DeploymentSpec.fromJson constructor

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

Creates a DeploymentSpec from JSON data.

Implementation

factory DeploymentSpec.fromJson(Map<String, dynamic> json) {
  final tempMinReadySecondsJson = json['minReadySeconds'];
  final tempPausedJson = json['paused'];
  final tempProgressDeadlineSecondsJson = json['progressDeadlineSeconds'];
  final tempReplicasJson = json['replicas'];
  final tempRevisionHistoryLimitJson = json['revisionHistoryLimit'];
  final tempSelectorJson = json['selector'];
  final tempStrategyJson = json['strategy'];
  final tempTemplateJson = json['template'];

  final int? tempMinReadySeconds = tempMinReadySecondsJson;
  final bool? tempPaused = tempPausedJson;
  final int? tempProgressDeadlineSeconds = tempProgressDeadlineSecondsJson;
  final int? tempReplicas = tempReplicasJson;
  final int? tempRevisionHistoryLimit = tempRevisionHistoryLimitJson;
  final LabelSelector tempSelector = LabelSelector.fromJson(tempSelectorJson);
  final DeploymentStrategy? tempStrategy = tempStrategyJson != null
      ? DeploymentStrategy.fromJson(tempStrategyJson)
      : null;
  final PodTemplateSpec tempTemplate =
      PodTemplateSpec.fromJson(tempTemplateJson);

  return DeploymentSpec(
    minReadySeconds: tempMinReadySeconds,
    paused: tempPaused,
    progressDeadlineSeconds: tempProgressDeadlineSeconds,
    replicas: tempReplicas,
    revisionHistoryLimit: tempRevisionHistoryLimit,
    selector: tempSelector,
    strategy: tempStrategy,
    template: tempTemplate,
  );
}