Tool_GoogleSearch.fromJson constructor

Tool_GoogleSearch.fromJson(
  1. Object? j
)

Implementation

factory Tool_GoogleSearch.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Tool_GoogleSearch(
    excludeDomains: switch (json['excludeDomains']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"excludeDomains" is not a list'),
    },
    blockingConfidence: switch (json['blockingConfidence']) {
      null => null,
      Object $1 => Tool_PhishBlockThreshold.fromJson($1),
    },
  );
}