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

/**
 * Options for enum properties, which allow you to define a restricted set of strings to match user
 * queries, set rankings for those string values, and define an operator name to be paired with
 * those strings so that users can narrow results to only items with a specific value. For example,
 * for items in a request tracking system with priority information, you could define *p0* as an
 * allowable enum value and tie this enum to the operator name *priority* so that search users could
 * add *priority:p0* to their query to restrict the set of results to only those items indexed with
 * the value *p0*.
 *
 * <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 EnumPropertyOptions extends com.google.api.client.json.GenericJson {

  /**
   * If set, describes how the enum should be used as a search operator.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private EnumOperatorOptions operatorOptions;

  /**
   * Used to specify the ordered ranking for the enumeration that determines how the integer values
   * provided in the possible EnumValuePairs are used to rank results. If specified, integer values
   * must be provided for all possible EnumValuePair values given for this property. Can only be
   * used if isRepeatable is false.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String orderedRanking;

  /**
   * The list of possible values for the enumeration property. All EnumValuePairs must provide a
   * string value. If you specify an integer value for one EnumValuePair, then all possible
   * EnumValuePairs must provide an integer value. Both the string value and integer value must be
   * unique over all possible values. Once set, possible values cannot be removed or modified. If
   * you supply an ordered ranking and think you might insert additional enum values in the future,
   * leave gaps in the initial integer values to allow adding a value in between previously
   * registered values. The maximum number of elements is 100.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<EnumValuePair> possibleValues;

  /**
   * If set, describes how the enum should be used as a search operator.
   * @return value or {@code null} for none
   */
  public EnumOperatorOptions getOperatorOptions() {
    return operatorOptions;
  }

  /**
   * If set, describes how the enum should be used as a search operator.
   * @param operatorOptions operatorOptions or {@code null} for none
   */
  public EnumPropertyOptions setOperatorOptions(EnumOperatorOptions operatorOptions) {
    this.operatorOptions = operatorOptions;
    return this;
  }

  /**
   * Used to specify the ordered ranking for the enumeration that determines how the integer values
   * provided in the possible EnumValuePairs are used to rank results. If specified, integer values
   * must be provided for all possible EnumValuePair values given for this property. Can only be
   * used if isRepeatable is false.
   * @return value or {@code null} for none
   */
  public java.lang.String getOrderedRanking() {
    return orderedRanking;
  }

  /**
   * Used to specify the ordered ranking for the enumeration that determines how the integer values
   * provided in the possible EnumValuePairs are used to rank results. If specified, integer values
   * must be provided for all possible EnumValuePair values given for this property. Can only be
   * used if isRepeatable is false.
   * @param orderedRanking orderedRanking or {@code null} for none
   */
  public EnumPropertyOptions setOrderedRanking(java.lang.String orderedRanking) {
    this.orderedRanking = orderedRanking;
    return this;
  }

  /**
   * The list of possible values for the enumeration property. All EnumValuePairs must provide a
   * string value. If you specify an integer value for one EnumValuePair, then all possible
   * EnumValuePairs must provide an integer value. Both the string value and integer value must be
   * unique over all possible values. Once set, possible values cannot be removed or modified. If
   * you supply an ordered ranking and think you might insert additional enum values in the future,
   * leave gaps in the initial integer values to allow adding a value in between previously
   * registered values. The maximum number of elements is 100.
   * @return value or {@code null} for none
   */
  public java.util.List<EnumValuePair> getPossibleValues() {
    return possibleValues;
  }

  /**
   * The list of possible values for the enumeration property. All EnumValuePairs must provide a
   * string value. If you specify an integer value for one EnumValuePair, then all possible
   * EnumValuePairs must provide an integer value. Both the string value and integer value must be
   * unique over all possible values. Once set, possible values cannot be removed or modified. If
   * you supply an ordered ranking and think you might insert additional enum values in the future,
   * leave gaps in the initial integer values to allow adding a value in between previously
   * registered values. The maximum number of elements is 100.
   * @param possibleValues possibleValues or {@code null} for none
   */
  public EnumPropertyOptions setPossibleValues(java.util.List<EnumValuePair> possibleValues) {
    this.possibleValues = possibleValues;
    return this;
  }

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

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

}
