HealthSourcesGetHealthResponseSourceInfo.fromJson constructor

HealthSourcesGetHealthResponseSourceInfo.fromJson(
  1. Object? j
)

Implementation

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