use of com.google.cloud.retail.v2.SearchResponse in project SonosOneDriveServer by bertique.
the class SonosService method search.
@Override
public SearchResponse search(Search parameters) throws CustomFault {
logger.debug("search");
GraphAuth auth = getGraphAuth();
String path = String.format("/me/drive/root/search(q='%s')", parameters.getTerm());
String skipToken = null;
if (parameters.getIndex() > 0) {
skipToken = getSkipToken(path, parameters.getIndex(), auth);
}
String json = graphApiGetRequest(path, parameters.getCount(), skipToken, auth);
SearchResponse response = new SearchResponse();
MediaList ml = new MediaList();
ml = parseMediaListResponse(auth.getHouseholdId(), json);
// Remove 1 since personal vault is not included in response
ml.setTotal(ml.getTotal());
ml.setIndex(parameters.getIndex());
response.setSearchResult(ml);
return response;
}
Aggregations