ListIndexEndpointsResponse.fromJson constructor

ListIndexEndpointsResponse.fromJson(
  1. Object? j
)

Implementation

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