ModelEvaluationSlice.fromJson constructor

ModelEvaluationSlice.fromJson(
  1. Object? j
)

Implementation

factory ModelEvaluationSlice.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ModelEvaluationSlice(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    slice: switch (json['slice']) {
      null => null,
      Object $1 => ModelEvaluationSlice_Slice.fromJson($1),
    },
    metricsSchemaUri: switch (json['metricsSchemaUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    metrics: switch ((json.containsKey('metrics'), json['metrics'])) {
      (false, _) => null,
      (true, Object? $1) => protobuf.Value.fromJson($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    modelExplanation: switch (json['modelExplanation']) {
      null => null,
      Object $1 => ModelExplanation.fromJson($1),
    },
  );
}