RuntimeClass.fromJson constructor

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

Creates a RuntimeClass from JSON data.

Implementation

factory RuntimeClass.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempHandlerJson = json['handler'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];
  final tempOverheadJson = json['overhead'];
  final tempSchedulingJson = json['scheduling'];

  final String? tempApiVersion = tempApiVersionJson;
  final String tempHandler = tempHandlerJson;
  final String? tempKind = tempKindJson;
  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
  final Overhead? tempOverhead =
      tempOverheadJson != null ? Overhead.fromJson(tempOverheadJson) : null;
  final Scheduling? tempScheduling = tempSchedulingJson != null
      ? Scheduling.fromJson(tempSchedulingJson)
      : null;

  return RuntimeClass(
    apiVersion: tempApiVersion,
    handler: tempHandler,
    kind: tempKind,
    metadata: tempMetadata,
    overhead: tempOverhead,
    scheduling: tempScheduling,
  );
}