StatefulSet.fromJson constructor

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

Creates a StatefulSet from JSON data.

Implementation

factory StatefulSet.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];
  final tempSpecJson = json['spec'];
  final tempStatusJson = json['status'];

  final String? tempApiVersion = tempApiVersionJson;
  final String? tempKind = tempKindJson;
  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
  final StatefulSetSpec? tempSpec =
      tempSpecJson != null ? StatefulSetSpec.fromJson(tempSpecJson) : null;
  final StatefulSetStatus? tempStatus = tempStatusJson != null
      ? StatefulSetStatus.fromJson(tempStatusJson)
      : null;

  return StatefulSet(
    apiVersion: tempApiVersion,
    kind: tempKind,
    metadata: tempMetadata,
    spec: tempSpec,
    status: tempStatus,
  );
}