/*
 * 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.contentwarehouse.v1.model;

/**
 * Values are effectively a union of several possible Knowledge Graph types: simple primitive
 * datatypes such as booleans, integers and floats, references to other Knowledge Graph topics (by
 * id), or "compound values" which are expressed as embedded topics with associated properties and
 * values. Values occur in indexed order (if any).
 *
 * <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 Document AI Warehouse 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 FreebaseValue extends com.google.api.client.json.GenericJson {

  /**
   * key, uri, or datetime. Present when value is bool.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean boolValue;

  /**
   * Citation data for this value. See: http://go/kg-clap
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseCitation citation;

  /**
   * Compound values are those that contain either a number of simple valued facets (such as a
   * latitude/longitude pair), or "mediator" topics representing multi-dimensional relationships
   * between topics. In both cases we represent them here with an embedded topic, although the
   * topic's identity is somewhat secondary to the property/value pairs it contains. (The identity
   * is still made available so that it can be used to perform updates to that mediator on the
   * Knowledge Graph.)
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseTopic compoundValue;

  /**
   * Deletion provenance for this value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<StorageGraphBfgTripleProvenance> deletionProvenance;

  /**
   * The lang of the display_value field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayLang;

  /**
   * The display value of this value. This is a i18n-aware formatted value if present.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayValue;

  /**
   * An optional name for a proto field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String expectedProto;

  /**
   * Present when value is float.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double floatValue;

  /**
   * Present when value is an id.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseId idValue;

  /**
   * Index of the value relative to the containing property (if any). Knowledge Graph supports a
   * loose notion of indexing: some non-unique properties may have indices, while others may not.
   * Furthermore, for a single property, some values may have indices (such as the top 5 actors in a
   * film), while others may not (the film's supporting cast). Un-indexed values will appear at the
   * end of the repeated value list. This field contains the index value only when is present in the
   * Knowledge Graph.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.math.BigInteger index;

  /**
   * Present when value is int.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long intValue;

  /**
   * Whenever the value is text with TYPE_TEXT, the lang field is populated with the III
   * LanguageCode associated with the string_value field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String lang;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseLatLong latLongValue;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseMeasurement measurementValue;

  /**
   * Populated if this value holds NestedStruct. 'type' field needs to be set to TYPE_NESTED_STRUCT.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private FreebaseNestedStruct nestedStruct;

  /**
   * Provenance for this value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<StorageGraphBfgTripleProvenance> provenance;

  /**
   * Similar to string_value/etc but contains raw bytes.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String rawValue;

  /**
   * Present when value is text, enum,
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String stringValue;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.util.List<java.math.BigInteger> subgraphId;

  /**
   * The ISO-8601 timestamp corresponding to when this value was created (when it was written to the
   * Knowledge Graph). Deprecated in favor of timestamp_usec.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String timestamp;

  /**
   * The microsecond timestamp corresponding to when this value was created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long timestampUsec;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String type;

  /**
   * key, uri, or datetime. Present when value is bool.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getBoolValue() {
    return boolValue;
  }

  /**
   * key, uri, or datetime. Present when value is bool.
   * @param boolValue boolValue or {@code null} for none
   */
  public FreebaseValue setBoolValue(java.lang.Boolean boolValue) {
    this.boolValue = boolValue;
    return this;
  }

  /**
   * Citation data for this value. See: http://go/kg-clap
   * @return value or {@code null} for none
   */
  public FreebaseCitation getCitation() {
    return citation;
  }

  /**
   * Citation data for this value. See: http://go/kg-clap
   * @param citation citation or {@code null} for none
   */
  public FreebaseValue setCitation(FreebaseCitation citation) {
    this.citation = citation;
    return this;
  }

  /**
   * Compound values are those that contain either a number of simple valued facets (such as a
   * latitude/longitude pair), or "mediator" topics representing multi-dimensional relationships
   * between topics. In both cases we represent them here with an embedded topic, although the
   * topic's identity is somewhat secondary to the property/value pairs it contains. (The identity
   * is still made available so that it can be used to perform updates to that mediator on the
   * Knowledge Graph.)
   * @return value or {@code null} for none
   */
  public FreebaseTopic getCompoundValue() {
    return compoundValue;
  }

  /**
   * Compound values are those that contain either a number of simple valued facets (such as a
   * latitude/longitude pair), or "mediator" topics representing multi-dimensional relationships
   * between topics. In both cases we represent them here with an embedded topic, although the
   * topic's identity is somewhat secondary to the property/value pairs it contains. (The identity
   * is still made available so that it can be used to perform updates to that mediator on the
   * Knowledge Graph.)
   * @param compoundValue compoundValue or {@code null} for none
   */
  public FreebaseValue setCompoundValue(FreebaseTopic compoundValue) {
    this.compoundValue = compoundValue;
    return this;
  }

  /**
   * Deletion provenance for this value.
   * @return value or {@code null} for none
   */
  public java.util.List<StorageGraphBfgTripleProvenance> getDeletionProvenance() {
    return deletionProvenance;
  }

  /**
   * Deletion provenance for this value.
   * @param deletionProvenance deletionProvenance or {@code null} for none
   */
  public FreebaseValue setDeletionProvenance(java.util.List<StorageGraphBfgTripleProvenance> deletionProvenance) {
    this.deletionProvenance = deletionProvenance;
    return this;
  }

  /**
   * The lang of the display_value field.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayLang() {
    return displayLang;
  }

  /**
   * The lang of the display_value field.
   * @param displayLang displayLang or {@code null} for none
   */
  public FreebaseValue setDisplayLang(java.lang.String displayLang) {
    this.displayLang = displayLang;
    return this;
  }

  /**
   * The display value of this value. This is a i18n-aware formatted value if present.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayValue() {
    return displayValue;
  }

  /**
   * The display value of this value. This is a i18n-aware formatted value if present.
   * @param displayValue displayValue or {@code null} for none
   */
  public FreebaseValue setDisplayValue(java.lang.String displayValue) {
    this.displayValue = displayValue;
    return this;
  }

  /**
   * An optional name for a proto field.
   * @return value or {@code null} for none
   */
  public java.lang.String getExpectedProto() {
    return expectedProto;
  }

  /**
   * An optional name for a proto field.
   * @param expectedProto expectedProto or {@code null} for none
   */
  public FreebaseValue setExpectedProto(java.lang.String expectedProto) {
    this.expectedProto = expectedProto;
    return this;
  }

  /**
   * Present when value is float.
   * @return value or {@code null} for none
   */
  public java.lang.Double getFloatValue() {
    return floatValue;
  }

  /**
   * Present when value is float.
   * @param floatValue floatValue or {@code null} for none
   */
  public FreebaseValue setFloatValue(java.lang.Double floatValue) {
    this.floatValue = floatValue;
    return this;
  }

  /**
   * Present when value is an id.
   * @return value or {@code null} for none
   */
  public FreebaseId getIdValue() {
    return idValue;
  }

  /**
   * Present when value is an id.
   * @param idValue idValue or {@code null} for none
   */
  public FreebaseValue setIdValue(FreebaseId idValue) {
    this.idValue = idValue;
    return this;
  }

  /**
   * Index of the value relative to the containing property (if any). Knowledge Graph supports a
   * loose notion of indexing: some non-unique properties may have indices, while others may not.
   * Furthermore, for a single property, some values may have indices (such as the top 5 actors in a
   * film), while others may not (the film's supporting cast). Un-indexed values will appear at the
   * end of the repeated value list. This field contains the index value only when is present in the
   * Knowledge Graph.
   * @return value or {@code null} for none
   */
  public java.math.BigInteger getIndex() {
    return index;
  }

  /**
   * Index of the value relative to the containing property (if any). Knowledge Graph supports a
   * loose notion of indexing: some non-unique properties may have indices, while others may not.
   * Furthermore, for a single property, some values may have indices (such as the top 5 actors in a
   * film), while others may not (the film's supporting cast). Un-indexed values will appear at the
   * end of the repeated value list. This field contains the index value only when is present in the
   * Knowledge Graph.
   * @param index index or {@code null} for none
   */
  public FreebaseValue setIndex(java.math.BigInteger index) {
    this.index = index;
    return this;
  }

  /**
   * Present when value is int.
   * @return value or {@code null} for none
   */
  public java.lang.Long getIntValue() {
    return intValue;
  }

  /**
   * Present when value is int.
   * @param intValue intValue or {@code null} for none
   */
  public FreebaseValue setIntValue(java.lang.Long intValue) {
    this.intValue = intValue;
    return this;
  }

  /**
   * Whenever the value is text with TYPE_TEXT, the lang field is populated with the III
   * LanguageCode associated with the string_value field.
   * @return value or {@code null} for none
   */
  public java.lang.String getLang() {
    return lang;
  }

  /**
   * Whenever the value is text with TYPE_TEXT, the lang field is populated with the III
   * LanguageCode associated with the string_value field.
   * @param lang lang or {@code null} for none
   */
  public FreebaseValue setLang(java.lang.String lang) {
    this.lang = lang;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public FreebaseLatLong getLatLongValue() {
    return latLongValue;
  }

  /**
   * @param latLongValue latLongValue or {@code null} for none
   */
  public FreebaseValue setLatLongValue(FreebaseLatLong latLongValue) {
    this.latLongValue = latLongValue;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public FreebaseMeasurement getMeasurementValue() {
    return measurementValue;
  }

  /**
   * @param measurementValue measurementValue or {@code null} for none
   */
  public FreebaseValue setMeasurementValue(FreebaseMeasurement measurementValue) {
    this.measurementValue = measurementValue;
    return this;
  }

  /**
   * Populated if this value holds NestedStruct. 'type' field needs to be set to TYPE_NESTED_STRUCT.
   * @return value or {@code null} for none
   */
  public FreebaseNestedStruct getNestedStruct() {
    return nestedStruct;
  }

  /**
   * Populated if this value holds NestedStruct. 'type' field needs to be set to TYPE_NESTED_STRUCT.
   * @param nestedStruct nestedStruct or {@code null} for none
   */
  public FreebaseValue setNestedStruct(FreebaseNestedStruct nestedStruct) {
    this.nestedStruct = nestedStruct;
    return this;
  }

  /**
   * Provenance for this value.
   * @return value or {@code null} for none
   */
  public java.util.List<StorageGraphBfgTripleProvenance> getProvenance() {
    return provenance;
  }

  /**
   * Provenance for this value.
   * @param provenance provenance or {@code null} for none
   */
  public FreebaseValue setProvenance(java.util.List<StorageGraphBfgTripleProvenance> provenance) {
    this.provenance = provenance;
    return this;
  }

  /**
   * Similar to string_value/etc but contains raw bytes.
   * @see #decodeRawValue()
   * @return value or {@code null} for none
   */
  public java.lang.String getRawValue() {
    return rawValue;
  }

  /**
   * Similar to string_value/etc but contains raw bytes.
   * @see #getRawValue()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeRawValue() {
    return com.google.api.client.util.Base64.decodeBase64(rawValue);
  }

  /**
   * Similar to string_value/etc but contains raw bytes.
   * @see #encodeRawValue()
   * @param rawValue rawValue or {@code null} for none
   */
  public FreebaseValue setRawValue(java.lang.String rawValue) {
    this.rawValue = rawValue;
    return this;
  }

  /**
   * Similar to string_value/etc but contains raw bytes.
   * @see #setRawValue()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public FreebaseValue encodeRawValue(byte[] rawValue) {
    this.rawValue = com.google.api.client.util.Base64.encodeBase64URLSafeString(rawValue);
    return this;
  }

  /**
   * Present when value is text, enum,
   * @return value or {@code null} for none
   */
  public java.lang.String getStringValue() {
    return stringValue;
  }

  /**
   * Present when value is text, enum,
   * @param stringValue stringValue or {@code null} for none
   */
  public FreebaseValue setStringValue(java.lang.String stringValue) {
    this.stringValue = stringValue;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.util.List<java.math.BigInteger> getSubgraphId() {
    return subgraphId;
  }

  /**
   * @param subgraphId subgraphId or {@code null} for none
   */
  public FreebaseValue setSubgraphId(java.util.List<java.math.BigInteger> subgraphId) {
    this.subgraphId = subgraphId;
    return this;
  }

  /**
   * The ISO-8601 timestamp corresponding to when this value was created (when it was written to the
   * Knowledge Graph). Deprecated in favor of timestamp_usec.
   * @return value or {@code null} for none
   */
  public java.lang.String getTimestamp() {
    return timestamp;
  }

  /**
   * The ISO-8601 timestamp corresponding to when this value was created (when it was written to the
   * Knowledge Graph). Deprecated in favor of timestamp_usec.
   * @param timestamp timestamp or {@code null} for none
   */
  public FreebaseValue setTimestamp(java.lang.String timestamp) {
    this.timestamp = timestamp;
    return this;
  }

  /**
   * The microsecond timestamp corresponding to when this value was created.
   * @return value or {@code null} for none
   */
  public java.lang.Long getTimestampUsec() {
    return timestampUsec;
  }

  /**
   * The microsecond timestamp corresponding to when this value was created.
   * @param timestampUsec timestampUsec or {@code null} for none
   */
  public FreebaseValue setTimestampUsec(java.lang.Long timestampUsec) {
    this.timestampUsec = timestampUsec;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getType() {
    return type;
  }

  /**
   * @param type type or {@code null} for none
   */
  public FreebaseValue setType(java.lang.String type) {
    this.type = type;
    return this;
  }

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

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

}
