ModelMonitoringStatsAnomalies.fromJson constructor

ModelMonitoringStatsAnomalies.fromJson(
  1. Object? j
)

Implementation

factory ModelMonitoringStatsAnomalies.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ModelMonitoringStatsAnomalies(
    objective: switch (json['objective']) {
      null => ModelDeploymentMonitoringObjectiveType.$default,
      Object $1 => ModelDeploymentMonitoringObjectiveType.fromJson($1),
    },
    deployedModelId: switch (json['deployedModelId']) {
      null => '',
      Object $1 => decodeString($1),
    },
    anomalyCount: switch (json['anomalyCount']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    featureStats: switch (json['featureStats']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1)
          ModelMonitoringStatsAnomalies_FeatureHistoricStatsAnomalies.fromJson(
            i,
          ),
      ],
      _ => throw const FormatException('"featureStats" is not a list'),
    },
  );
}