All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.algolia.model.search.BrowseResponse Maven / Gradle / Ivy

The newest version!
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

package com.algolia.model.search;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** BrowseResponse */
public class BrowseResponse {

  @JsonProperty("abTestID")
  private Integer abTestID;

  @JsonProperty("abTestVariantID")
  private Integer abTestVariantID;

  @JsonProperty("aroundLatLng")
  private String aroundLatLng;

  @JsonProperty("automaticRadius")
  private String automaticRadius;

  @JsonProperty("exhaustive")
  private Exhaustive exhaustive;

  @JsonProperty("appliedRules")
  private List appliedRules;

  @JsonProperty("exhaustiveFacetsCount")
  private Boolean exhaustiveFacetsCount;

  @JsonProperty("exhaustiveNbHits")
  private Boolean exhaustiveNbHits;

  @JsonProperty("exhaustiveTypo")
  private Boolean exhaustiveTypo;

  @JsonProperty("facets")
  private Map> facets;

  @JsonProperty("facets_stats")
  private Map facetsStats;

  @JsonProperty("index")
  private String index;

  @JsonProperty("indexUsed")
  private String indexUsed;

  @JsonProperty("message")
  private String message;

  @JsonProperty("nbSortedHits")
  private Integer nbSortedHits;

  @JsonProperty("parsedQuery")
  private String parsedQuery;

  @JsonProperty("processingTimeMS")
  private Integer processingTimeMS;

  @JsonProperty("processingTimingsMS")
  private Object processingTimingsMS;

  @JsonProperty("queryAfterRemoval")
  private String queryAfterRemoval;

  @JsonProperty("redirect")
  private Redirect redirect;

  @JsonProperty("renderingContent")
  private RenderingContent renderingContent;

  @JsonProperty("serverTimeMS")
  private Integer serverTimeMS;

  @JsonProperty("serverUsed")
  private String serverUsed;

  @JsonProperty("userData")
  private Object userData;

  @JsonProperty("queryID")
  private String queryID;

  @JsonProperty("_automaticInsights")
  private Boolean automaticInsights;

  @JsonProperty("page")
  private Integer page;

  @JsonProperty("nbHits")
  private Integer nbHits;

  @JsonProperty("nbPages")
  private Integer nbPages;

  @JsonProperty("hitsPerPage")
  private Integer hitsPerPage;

  @JsonProperty("hits")
  private List hits = new ArrayList<>();

  @JsonProperty("query")
  private String query;

  @JsonProperty("params")
  private String params;

  @JsonProperty("cursor")
  private String cursor;

  public BrowseResponse setAbTestID(Integer abTestID) {
    this.abTestID = abTestID;
    return this;
  }

  /**
   * A/B test ID. This is only included in the response for indices that are part of an A/B test.
   */
  @javax.annotation.Nullable
  public Integer getAbTestID() {
    return abTestID;
  }

  public BrowseResponse setAbTestVariantID(Integer abTestVariantID) {
    this.abTestVariantID = abTestVariantID;
    return this;
  }

  /**
   * Variant ID. This is only included in the response for indices that are part of an A/B test.
   * minimum: 1
   */
  @javax.annotation.Nullable
  public Integer getAbTestVariantID() {
    return abTestVariantID;
  }

  public BrowseResponse setAroundLatLng(String aroundLatLng) {
    this.aroundLatLng = aroundLatLng;
    return this;
  }

  /** Computed geographical location. */
  @javax.annotation.Nullable
  public String getAroundLatLng() {
    return aroundLatLng;
  }

  public BrowseResponse setAutomaticRadius(String automaticRadius) {
    this.automaticRadius = automaticRadius;
    return this;
  }

  /** Distance from a central coordinate provided by `aroundLatLng`. */
  @javax.annotation.Nullable
  public String getAutomaticRadius() {
    return automaticRadius;
  }

  public BrowseResponse setExhaustive(Exhaustive exhaustive) {
    this.exhaustive = exhaustive;
    return this;
  }

  /** Get exhaustive */
  @javax.annotation.Nullable
  public Exhaustive getExhaustive() {
    return exhaustive;
  }

  public BrowseResponse setAppliedRules(List appliedRules) {
    this.appliedRules = appliedRules;
    return this;
  }

  public BrowseResponse addAppliedRules(Object appliedRulesItem) {
    if (this.appliedRules == null) {
      this.appliedRules = new ArrayList<>();
    }
    this.appliedRules.add(appliedRulesItem);
    return this;
  }

  /** Rules applied to the query. */
  @javax.annotation.Nullable
  public List getAppliedRules() {
    return appliedRules;
  }

  public BrowseResponse setExhaustiveFacetsCount(Boolean exhaustiveFacetsCount) {
    this.exhaustiveFacetsCount = exhaustiveFacetsCount;
    return this;
  }

  /**
   * See the `facetsCount` field of the `exhaustive` object in the response.
   *
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  public Boolean getExhaustiveFacetsCount() {
    return exhaustiveFacetsCount;
  }

  public BrowseResponse setExhaustiveNbHits(Boolean exhaustiveNbHits) {
    this.exhaustiveNbHits = exhaustiveNbHits;
    return this;
  }

  /**
   * See the `nbHits` field of the `exhaustive` object in the response.
   *
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  public Boolean getExhaustiveNbHits() {
    return exhaustiveNbHits;
  }

  public BrowseResponse setExhaustiveTypo(Boolean exhaustiveTypo) {
    this.exhaustiveTypo = exhaustiveTypo;
    return this;
  }

  /**
   * See the `typo` field of the `exhaustive` object in the response.
   *
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  public Boolean getExhaustiveTypo() {
    return exhaustiveTypo;
  }

  public BrowseResponse setFacets(Map> facets) {
    this.facets = facets;
    return this;
  }

  public BrowseResponse putFacets(String key, Map facetsItem) {
    if (this.facets == null) {
      this.facets = new HashMap<>();
    }
    this.facets.put(key, facetsItem);
    return this;
  }

  /** Facet counts. */
  @javax.annotation.Nullable
  public Map> getFacets() {
    return facets;
  }

  public BrowseResponse setFacetsStats(Map facetsStats) {
    this.facetsStats = facetsStats;
    return this;
  }

  public BrowseResponse putFacetsStats(String key, FacetStats facetsStatsItem) {
    if (this.facetsStats == null) {
      this.facetsStats = new HashMap<>();
    }
    this.facetsStats.put(key, facetsStatsItem);
    return this;
  }

  /** Statistics for numerical facets. */
  @javax.annotation.Nullable
  public Map getFacetsStats() {
    return facetsStats;
  }

  public BrowseResponse setIndex(String index) {
    this.index = index;
    return this;
  }

  /** Index name used for the query. */
  @javax.annotation.Nullable
  public String getIndex() {
    return index;
  }

  public BrowseResponse setIndexUsed(String indexUsed) {
    this.indexUsed = indexUsed;
    return this;
  }

  /**
   * Index name used for the query. During A/B testing, the targeted index isn't always the index
   * used by the query.
   */
  @javax.annotation.Nullable
  public String getIndexUsed() {
    return indexUsed;
  }

  public BrowseResponse setMessage(String message) {
    this.message = message;
    return this;
  }

  /** Warnings about the query. */
  @javax.annotation.Nullable
  public String getMessage() {
    return message;
  }

  public BrowseResponse setNbSortedHits(Integer nbSortedHits) {
    this.nbSortedHits = nbSortedHits;
    return this;
  }

  /** Number of hits selected and sorted by the relevant sort algorithm. */
  @javax.annotation.Nullable
  public Integer getNbSortedHits() {
    return nbSortedHits;
  }

  public BrowseResponse setParsedQuery(String parsedQuery) {
    this.parsedQuery = parsedQuery;
    return this;
  }

  /**
   * Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean)
   * query string that will be searched.
   */
  @javax.annotation.Nullable
  public String getParsedQuery() {
    return parsedQuery;
  }

  public BrowseResponse setProcessingTimeMS(Integer processingTimeMS) {
    this.processingTimeMS = processingTimeMS;
    return this;
  }

  /** Time the server took to process the request, in milliseconds. */
  @javax.annotation.Nonnull
  public Integer getProcessingTimeMS() {
    return processingTimeMS;
  }

  public BrowseResponse setProcessingTimingsMS(Object processingTimingsMS) {
    this.processingTimingsMS = processingTimingsMS;
    return this;
  }

  /**
   * Experimental. List of processing steps and their times, in milliseconds. You can use this list
   * to investigate performance issues.
   */
  @javax.annotation.Nullable
  public Object getProcessingTimingsMS() {
    return processingTimingsMS;
  }

  public BrowseResponse setQueryAfterRemoval(String queryAfterRemoval) {
    this.queryAfterRemoval = queryAfterRemoval;
    return this;
  }

  /**
   * Markup text indicating which parts of the original query have been removed to retrieve a
   * non-empty result set.
   */
  @javax.annotation.Nullable
  public String getQueryAfterRemoval() {
    return queryAfterRemoval;
  }

  public BrowseResponse setRedirect(Redirect redirect) {
    this.redirect = redirect;
    return this;
  }

  /** Get redirect */
  @javax.annotation.Nullable
  public Redirect getRedirect() {
    return redirect;
  }

  public BrowseResponse setRenderingContent(RenderingContent renderingContent) {
    this.renderingContent = renderingContent;
    return this;
  }

  /** Get renderingContent */
  @javax.annotation.Nullable
  public RenderingContent getRenderingContent() {
    return renderingContent;
  }

  public BrowseResponse setServerTimeMS(Integer serverTimeMS) {
    this.serverTimeMS = serverTimeMS;
    return this;
  }

  /** Time the server took to process the request, in milliseconds. */
  @javax.annotation.Nullable
  public Integer getServerTimeMS() {
    return serverTimeMS;
  }

  public BrowseResponse setServerUsed(String serverUsed) {
    this.serverUsed = serverUsed;
    return this;
  }

  /** Host name of the server that processed the request. */
  @javax.annotation.Nullable
  public String getServerUsed() {
    return serverUsed;
  }

  public BrowseResponse setUserData(Object userData) {
    this.userData = userData;
    return this;
  }

  /** An object with custom data. You can store up to 32kB as custom data. */
  @javax.annotation.Nullable
  public Object getUserData() {
    return userData;
  }

  public BrowseResponse setQueryID(String queryID) {
    this.queryID = queryID;
    return this;
  }

  /**
   * Unique identifier for the query. This is used for [click
   * analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
   */
  @javax.annotation.Nullable
  public String getQueryID() {
    return queryID;
  }

  public BrowseResponse setAutomaticInsights(Boolean automaticInsights) {
    this.automaticInsights = automaticInsights;
    return this;
  }

  /** Whether automatic events collection is enabled for the application. */
  @javax.annotation.Nullable
  public Boolean getAutomaticInsights() {
    return automaticInsights;
  }

  public BrowseResponse setPage(Integer page) {
    this.page = page;
    return this;
  }

  /** Page of search results to retrieve. minimum: 0 */
  @javax.annotation.Nullable
  public Integer getPage() {
    return page;
  }

  public BrowseResponse setNbHits(Integer nbHits) {
    this.nbHits = nbHits;
    return this;
  }

  /** Number of results (hits). */
  @javax.annotation.Nullable
  public Integer getNbHits() {
    return nbHits;
  }

  public BrowseResponse setNbPages(Integer nbPages) {
    this.nbPages = nbPages;
    return this;
  }

  /** Number of pages of results. */
  @javax.annotation.Nullable
  public Integer getNbPages() {
    return nbPages;
  }

  public BrowseResponse setHitsPerPage(Integer hitsPerPage) {
    this.hitsPerPage = hitsPerPage;
    return this;
  }

  /** Number of hits per page. minimum: 1 maximum: 1000 */
  @javax.annotation.Nullable
  public Integer getHitsPerPage() {
    return hitsPerPage;
  }

  public BrowseResponse setHits(List hits) {
    this.hits = hits;
    return this;
  }

  public BrowseResponse addHits(T hitsItem) {
    this.hits.add(hitsItem);
    return this;
  }

  /**
   * Search results (hits). Hits are records from your index that match the search criteria,
   * augmented with additional attributes, such as, for highlighting.
   */
  @javax.annotation.Nonnull
  public List getHits() {
    return hits;
  }

  public BrowseResponse setQuery(String query) {
    this.query = query;
    return this;
  }

  /** Search query. */
  @javax.annotation.Nonnull
  public String getQuery() {
    return query;
  }

  public BrowseResponse setParams(String params) {
    this.params = params;
    return this;
  }

  /** URL-encoded string of all search parameters. */
  @javax.annotation.Nonnull
  public String getParams() {
    return params;
  }

  public BrowseResponse setCursor(String cursor) {
    this.cursor = cursor;
    return this;
  }

  /**
   * Cursor to get the next page of the response. The parameter must match the value returned in the
   * response of a previous request. The last page of the response does not return a `cursor`
   * attribute.
   */
  @javax.annotation.Nullable
  public String getCursor() {
    return cursor;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BrowseResponse browseResponse = (BrowseResponse) o;
    return (
      Objects.equals(this.abTestID, browseResponse.abTestID) &&
      Objects.equals(this.abTestVariantID, browseResponse.abTestVariantID) &&
      Objects.equals(this.aroundLatLng, browseResponse.aroundLatLng) &&
      Objects.equals(this.automaticRadius, browseResponse.automaticRadius) &&
      Objects.equals(this.exhaustive, browseResponse.exhaustive) &&
      Objects.equals(this.appliedRules, browseResponse.appliedRules) &&
      Objects.equals(this.exhaustiveFacetsCount, browseResponse.exhaustiveFacetsCount) &&
      Objects.equals(this.exhaustiveNbHits, browseResponse.exhaustiveNbHits) &&
      Objects.equals(this.exhaustiveTypo, browseResponse.exhaustiveTypo) &&
      Objects.equals(this.facets, browseResponse.facets) &&
      Objects.equals(this.facetsStats, browseResponse.facetsStats) &&
      Objects.equals(this.index, browseResponse.index) &&
      Objects.equals(this.indexUsed, browseResponse.indexUsed) &&
      Objects.equals(this.message, browseResponse.message) &&
      Objects.equals(this.nbSortedHits, browseResponse.nbSortedHits) &&
      Objects.equals(this.parsedQuery, browseResponse.parsedQuery) &&
      Objects.equals(this.processingTimeMS, browseResponse.processingTimeMS) &&
      Objects.equals(this.processingTimingsMS, browseResponse.processingTimingsMS) &&
      Objects.equals(this.queryAfterRemoval, browseResponse.queryAfterRemoval) &&
      Objects.equals(this.redirect, browseResponse.redirect) &&
      Objects.equals(this.renderingContent, browseResponse.renderingContent) &&
      Objects.equals(this.serverTimeMS, browseResponse.serverTimeMS) &&
      Objects.equals(this.serverUsed, browseResponse.serverUsed) &&
      Objects.equals(this.userData, browseResponse.userData) &&
      Objects.equals(this.queryID, browseResponse.queryID) &&
      Objects.equals(this.automaticInsights, browseResponse.automaticInsights) &&
      Objects.equals(this.page, browseResponse.page) &&
      Objects.equals(this.nbHits, browseResponse.nbHits) &&
      Objects.equals(this.nbPages, browseResponse.nbPages) &&
      Objects.equals(this.hitsPerPage, browseResponse.hitsPerPage) &&
      Objects.equals(this.hits, browseResponse.hits) &&
      Objects.equals(this.query, browseResponse.query) &&
      Objects.equals(this.params, browseResponse.params) &&
      Objects.equals(this.cursor, browseResponse.cursor)
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      abTestID,
      abTestVariantID,
      aroundLatLng,
      automaticRadius,
      exhaustive,
      appliedRules,
      exhaustiveFacetsCount,
      exhaustiveNbHits,
      exhaustiveTypo,
      facets,
      facetsStats,
      index,
      indexUsed,
      message,
      nbSortedHits,
      parsedQuery,
      processingTimeMS,
      processingTimingsMS,
      queryAfterRemoval,
      redirect,
      renderingContent,
      serverTimeMS,
      serverUsed,
      userData,
      queryID,
      automaticInsights,
      page,
      nbHits,
      nbPages,
      hitsPerPage,
      hits,
      query,
      params,
      cursor
    );
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BrowseResponse {\n");
    sb.append("    abTestID: ").append(toIndentedString(abTestID)).append("\n");
    sb.append("    abTestVariantID: ").append(toIndentedString(abTestVariantID)).append("\n");
    sb.append("    aroundLatLng: ").append(toIndentedString(aroundLatLng)).append("\n");
    sb.append("    automaticRadius: ").append(toIndentedString(automaticRadius)).append("\n");
    sb.append("    exhaustive: ").append(toIndentedString(exhaustive)).append("\n");
    sb.append("    appliedRules: ").append(toIndentedString(appliedRules)).append("\n");
    sb.append("    exhaustiveFacetsCount: ").append(toIndentedString(exhaustiveFacetsCount)).append("\n");
    sb.append("    exhaustiveNbHits: ").append(toIndentedString(exhaustiveNbHits)).append("\n");
    sb.append("    exhaustiveTypo: ").append(toIndentedString(exhaustiveTypo)).append("\n");
    sb.append("    facets: ").append(toIndentedString(facets)).append("\n");
    sb.append("    facetsStats: ").append(toIndentedString(facetsStats)).append("\n");
    sb.append("    index: ").append(toIndentedString(index)).append("\n");
    sb.append("    indexUsed: ").append(toIndentedString(indexUsed)).append("\n");
    sb.append("    message: ").append(toIndentedString(message)).append("\n");
    sb.append("    nbSortedHits: ").append(toIndentedString(nbSortedHits)).append("\n");
    sb.append("    parsedQuery: ").append(toIndentedString(parsedQuery)).append("\n");
    sb.append("    processingTimeMS: ").append(toIndentedString(processingTimeMS)).append("\n");
    sb.append("    processingTimingsMS: ").append(toIndentedString(processingTimingsMS)).append("\n");
    sb.append("    queryAfterRemoval: ").append(toIndentedString(queryAfterRemoval)).append("\n");
    sb.append("    redirect: ").append(toIndentedString(redirect)).append("\n");
    sb.append("    renderingContent: ").append(toIndentedString(renderingContent)).append("\n");
    sb.append("    serverTimeMS: ").append(toIndentedString(serverTimeMS)).append("\n");
    sb.append("    serverUsed: ").append(toIndentedString(serverUsed)).append("\n");
    sb.append("    userData: ").append(toIndentedString(userData)).append("\n");
    sb.append("    queryID: ").append(toIndentedString(queryID)).append("\n");
    sb.append("    automaticInsights: ").append(toIndentedString(automaticInsights)).append("\n");
    sb.append("    page: ").append(toIndentedString(page)).append("\n");
    sb.append("    nbHits: ").append(toIndentedString(nbHits)).append("\n");
    sb.append("    nbPages: ").append(toIndentedString(nbPages)).append("\n");
    sb.append("    hitsPerPage: ").append(toIndentedString(hitsPerPage)).append("\n");
    sb.append("    hits: ").append(toIndentedString(hits)).append("\n");
    sb.append("    query: ").append(toIndentedString(query)).append("\n");
    sb.append("    params: ").append(toIndentedString(params)).append("\n");
    sb.append("    cursor: ").append(toIndentedString(cursor)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}