MLModel.fromJson constructor

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

Implementation

factory MLModel.fromJson(Map<String, dynamic> json) {
  return MLModel(
    algorithm: (json['Algorithm'] as String?)?.toAlgorithm(),
    computeTime: json['ComputeTime'] as int?,
    createdAt: timeStampFromJson(json['CreatedAt']),
    createdByIamUser: json['CreatedByIamUser'] as String?,
    endpointInfo: json['EndpointInfo'] != null
        ? RealtimeEndpointInfo.fromJson(
            json['EndpointInfo'] as Map<String, dynamic>)
        : null,
    finishedAt: timeStampFromJson(json['FinishedAt']),
    inputDataLocationS3: json['InputDataLocationS3'] as String?,
    lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']),
    mLModelId: json['MLModelId'] as String?,
    mLModelType: (json['MLModelType'] as String?)?.toMLModelType(),
    message: json['Message'] as String?,
    name: json['Name'] as String?,
    scoreThreshold: json['ScoreThreshold'] as double?,
    scoreThresholdLastUpdatedAt:
        timeStampFromJson(json['ScoreThresholdLastUpdatedAt']),
    sizeInBytes: json['SizeInBytes'] as int?,
    startedAt: timeStampFromJson(json['StartedAt']),
    status: (json['Status'] as String?)?.toEntityStatus(),
    trainingDataSourceId: json['TrainingDataSourceId'] as String?,
    trainingParameters: (json['TrainingParameters'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
  );
}