ListOperationsResponse.fromJson constructor

ListOperationsResponse.fromJson(
  1. Object? j
)

Implementation

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