/*
 * 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;

/**
 * Set search results crowding limits. Crowding is a situation in which multiple results from the
 * same source or host "crowd out" other results, diminishing the quality of search for users. To
 * foster better search quality and source diversity in search results, you can set a condition to
 * reduce repetitive results by source.
 *
 * <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 SourceCrowdingConfig extends com.google.api.client.json.GenericJson {

  /**
   * Maximum number of results allowed from a datasource in a result page as long as results from
   * other sources are not exhausted. Value specified must not be negative. A default value is used
   * if this value is equal to 0. To disable crowding, set the value greater than 100.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer numResults;

  /**
   * Maximum number of suggestions allowed from a source. No limits will be set on results if this
   * value is less than or equal to 0.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer numSuggestions;

  /**
   * Maximum number of results allowed from a datasource in a result page as long as results from
   * other sources are not exhausted. Value specified must not be negative. A default value is used
   * if this value is equal to 0. To disable crowding, set the value greater than 100.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getNumResults() {
    return numResults;
  }

  /**
   * Maximum number of results allowed from a datasource in a result page as long as results from
   * other sources are not exhausted. Value specified must not be negative. A default value is used
   * if this value is equal to 0. To disable crowding, set the value greater than 100.
   * @param numResults numResults or {@code null} for none
   */
  public SourceCrowdingConfig setNumResults(java.lang.Integer numResults) {
    this.numResults = numResults;
    return this;
  }

  /**
   * Maximum number of suggestions allowed from a source. No limits will be set on results if this
   * value is less than or equal to 0.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getNumSuggestions() {
    return numSuggestions;
  }

  /**
   * Maximum number of suggestions allowed from a source. No limits will be set on results if this
   * value is less than or equal to 0.
   * @param numSuggestions numSuggestions or {@code null} for none
   */
  public SourceCrowdingConfig setNumSuggestions(java.lang.Integer numSuggestions) {
    this.numSuggestions = numSuggestions;
    return this;
  }

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

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

}
