ReplicaSetStatus.fromJson constructor

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

Creates a ReplicaSetStatus from JSON data.

Implementation

factory ReplicaSetStatus.fromJson(Map<String, dynamic> json) {
  final tempAvailableReplicasJson = json['availableReplicas'];
  final tempConditionsJson = json['conditions'];
  final tempFullyLabeledReplicasJson = json['fullyLabeledReplicas'];
  final tempObservedGenerationJson = json['observedGeneration'];
  final tempReadyReplicasJson = json['readyReplicas'];
  final tempReplicasJson = json['replicas'];

  final int? tempAvailableReplicas = tempAvailableReplicasJson;

  final List<ReplicaSetCondition>? tempConditions = tempConditionsJson != null
      ? List<dynamic>.from(tempConditionsJson)
          .map(
            (e) => ReplicaSetCondition.fromJson(
              Map<String, dynamic>.from(e),
            ),
          )
          .toList()
      : null;

  final int? tempFullyLabeledReplicas = tempFullyLabeledReplicasJson;
  final int? tempObservedGeneration = tempObservedGenerationJson;
  final int? tempReadyReplicas = tempReadyReplicasJson;
  final int tempReplicas = tempReplicasJson;

  return ReplicaSetStatus(
    availableReplicas: tempAvailableReplicas,
    conditions: tempConditions,
    fullyLabeledReplicas: tempFullyLabeledReplicas,
    observedGeneration: tempObservedGeneration,
    readyReplicas: tempReadyReplicas,
    replicas: tempReplicas,
  );
}