/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudsearch.v1.model;

/**
 * Results containing indexed information for a document.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Search API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class SearchResult extends com.google.api.client.json.GenericJson {

  /**
   * If source is clustered, provide list of clustered results. There will only be one level of
   * clustered results. If current source is not enabled for clustering, this field will be empty.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<SearchResult> clusteredResults;

  /**
   * Debugging information about this search result.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ResultDebugInfo debugInfo;

  /**
   * Metadata of the search result.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Metadata metadata;

  /**
   * The concatenation of all snippets (summaries) available for this result.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Snippet snippet;

  /**
   * Title of the search result.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String title;

  /**
   * The URL of the search result. The URL contains a Google redirect to the actual item. This URL
   * is signed and shouldn't be changed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String url;

  /**
   * If source is clustered, provide list of clustered results. There will only be one level of
   * clustered results. If current source is not enabled for clustering, this field will be empty.
   * @return value or {@code null} for none
   */
  public java.util.List<SearchResult> getClusteredResults() {
    return clusteredResults;
  }

  /**
   * If source is clustered, provide list of clustered results. There will only be one level of
   * clustered results. If current source is not enabled for clustering, this field will be empty.
   * @param clusteredResults clusteredResults or {@code null} for none
   */
  public SearchResult setClusteredResults(java.util.List<SearchResult> clusteredResults) {
    this.clusteredResults = clusteredResults;
    return this;
  }

  /**
   * Debugging information about this search result.
   * @return value or {@code null} for none
   */
  public ResultDebugInfo getDebugInfo() {
    return debugInfo;
  }

  /**
   * Debugging information about this search result.
   * @param debugInfo debugInfo or {@code null} for none
   */
  public SearchResult setDebugInfo(ResultDebugInfo debugInfo) {
    this.debugInfo = debugInfo;
    return this;
  }

  /**
   * Metadata of the search result.
   * @return value or {@code null} for none
   */
  public Metadata getMetadata() {
    return metadata;
  }

  /**
   * Metadata of the search result.
   * @param metadata metadata or {@code null} for none
   */
  public SearchResult setMetadata(Metadata metadata) {
    this.metadata = metadata;
    return this;
  }

  /**
   * The concatenation of all snippets (summaries) available for this result.
   * @return value or {@code null} for none
   */
  public Snippet getSnippet() {
    return snippet;
  }

  /**
   * The concatenation of all snippets (summaries) available for this result.
   * @param snippet snippet or {@code null} for none
   */
  public SearchResult setSnippet(Snippet snippet) {
    this.snippet = snippet;
    return this;
  }

  /**
   * Title of the search result.
   * @return value or {@code null} for none
   */
  public java.lang.String getTitle() {
    return title;
  }

  /**
   * Title of the search result.
   * @param title title or {@code null} for none
   */
  public SearchResult setTitle(java.lang.String title) {
    this.title = title;
    return this;
  }

  /**
   * The URL of the search result. The URL contains a Google redirect to the actual item. This URL
   * is signed and shouldn't be changed.
   * @return value or {@code null} for none
   */
  public java.lang.String getUrl() {
    return url;
  }

  /**
   * The URL of the search result. The URL contains a Google redirect to the actual item. This URL
   * is signed and shouldn't be changed.
   * @param url url or {@code null} for none
   */
  public SearchResult setUrl(java.lang.String url) {
    this.url = url;
    return this;
  }

  @Override
  public SearchResult set(String fieldName, Object value) {
    return (SearchResult) super.set(fieldName, value);
  }

  @Override
  public SearchResult clone() {
    return (SearchResult) super.clone();
  }

}
