FindNeighborsRequest.fromJson constructor

FindNeighborsRequest.fromJson(
  1. Object? j
)

Implementation

factory FindNeighborsRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return FindNeighborsRequest(
    indexEndpoint: switch (json['indexEndpoint']) {
      null => '',
      Object $1 => decodeString($1),
    },
    deployedIndexId: switch (json['deployedIndexId']) {
      null => '',
      Object $1 => decodeString($1),
    },
    queries: switch (json['queries']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) FindNeighborsRequest_Query.fromJson(i),
      ],
      _ => throw const FormatException('"queries" is not a list'),
    },
    returnFullDatapoint: switch (json['returnFullDatapoint']) {
      null => false,
      Object $1 => decodeBool($1),
    },
  );
}