JobTemplateSpec.fromJson constructor

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

Creates a JobTemplateSpec from JSON data.

Implementation

factory JobTemplateSpec.fromJson(Map<String, dynamic> json) {
  final tempMetadataJson = json['metadata'];
  final tempSpecJson = json['spec'];

  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
  final JobSpec? tempSpec =
      tempSpecJson != null ? JobSpec.fromJson(tempSpecJson) : null;

  return JobTemplateSpec(
    metadata: tempMetadata,
    spec: tempSpec,
  );
}