// Methods for accessing fields of MetadataResponse

function getQuery(response) {
  return response.response.query;
}

function getHints(object) {
  return object.hint;
}

function getSuggestions(response) {
  var suggestions = response.response.suggestions.facet;
  return suggestions;
}

function getSuggestionName(suggestion) {
  return suggestion.name;
}

function getSuggestionRows(suggestion) {
  return suggestion.suggestion;
}

function getSuggestionRowValue(suggestionRow) {
  return suggestionRow.value;
}

function getSuggestionRowDisplayValue(suggestionRow) {
  return suggestionRow.displayvalue;
}

function getSuggestionRowSortValue(suggestionRow) {
  return suggestionRow.sortvalue;
}

function getSuggestionRowItemCount(suggestionRow) {
  return suggestionRow.itemcount;
}

function getHint(object, hintName) {
  return getHints(object)[hintName];
}

function getGroups(response) {
  return response.response.groups.group;
}

function getDataItems(group) {
  return group.data_item;
}

function getResourceForDataItem(dataItem) {
  return dataItem.resource;
}

function getFacetBindingsForDataItem(dataItem) {
  return dataItem.facet_binding;
}

function getNameForFacetBinding(facetBinding) {
  return facetBinding.name;
}

function getFacetValuesForFacetBinding(facetBinding) {
  return facetBinding.facet_value;
}

function getResourceForFacetValue(facetValue) {
  return facetValue.resource;
}

function getTextValueForFacetValue(facetValue) {
  return facetValue.text_value;
}
