ModelMonitoringAlertConfig.fromJson constructor

ModelMonitoringAlertConfig.fromJson(
  1. Object? j
)

Implementation

factory ModelMonitoringAlertConfig.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ModelMonitoringAlertConfig(
    emailAlertConfig: switch (json['emailAlertConfig']) {
      null => null,
      Object $1 => ModelMonitoringAlertConfig_EmailAlertConfig.fromJson($1),
    },
    enableLogging: switch (json['enableLogging']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    notificationChannels: switch (json['notificationChannels']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"notificationChannels" is not a list',
      ),
    },
  );
}