ReliabilityRisksListResponse.fromJson constructor

ReliabilityRisksListResponse.fromJson(
  1. Object? j
)

Implementation

factory ReliabilityRisksListResponse.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ReliabilityRisksListResponse(
    etag: switch (json['etag']) {
      null => null,
      Object $1 => decodeString($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeString($1),
    },
    items: switch (json['items']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) ReliabilityRisk.fromJson(i)],
      _ => throw const FormatException('"items" is not a list'),
    },
    nextPageToken: switch (json['nextPageToken']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    unreachables: switch (json['unreachables']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"unreachables" is not a list'),
    },
    warning: switch (json['warning']) {
      null => null,
      Object $1 => Warning.fromJson($1),
    },
  );
}