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

/**
 * Model definition for CaribouAttributeValue.
 *
 * <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 CaribouAttributeValue extends com.google.api.client.json.GenericJson {

  /**
   * Tags 1 through 15 are reserved for the most commonly used fields.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean booleanValue;

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

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

  /**
   * Generally, applications should avoid storing raw bytes and instead store structured data as
   * protocol buffer extensions. This both reduces the amount of ad-hoc attribute parsing code as
   * well as eliminates an intermediate copy of the data when deserializing the value. The
   * rawByteValue field is mainly provided for compatibility with attributes stored before the
   * introduction of the Attribute.Value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String rawByteValue;

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

  /**
   * Tags 1 through 15 are reserved for the most commonly used fields.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getBooleanValue() {
    return booleanValue;
  }

  /**
   * Tags 1 through 15 are reserved for the most commonly used fields.
   * @param booleanValue booleanValue or {@code null} for none
   */
  public CaribouAttributeValue setBooleanValue(java.lang.Boolean booleanValue) {
    this.booleanValue = booleanValue;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Integer getIntValue() {
    return intValue;
  }

  /**
   * @param intValue intValue or {@code null} for none
   */
  public CaribouAttributeValue setIntValue(java.lang.Integer intValue) {
    this.intValue = intValue;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Long getLongValue() {
    return longValue;
  }

  /**
   * @param longValue longValue or {@code null} for none
   */
  public CaribouAttributeValue setLongValue(java.lang.Long longValue) {
    this.longValue = longValue;
    return this;
  }

  /**
   * Generally, applications should avoid storing raw bytes and instead store structured data as
   * protocol buffer extensions. This both reduces the amount of ad-hoc attribute parsing code as
   * well as eliminates an intermediate copy of the data when deserializing the value. The
   * rawByteValue field is mainly provided for compatibility with attributes stored before the
   * introduction of the Attribute.Value.
   * @see #decodeRawByteValue()
   * @return value or {@code null} for none
   */
  public java.lang.String getRawByteValue() {
    return rawByteValue;
  }

  /**
   * Generally, applications should avoid storing raw bytes and instead store structured data as
   * protocol buffer extensions. This both reduces the amount of ad-hoc attribute parsing code as
   * well as eliminates an intermediate copy of the data when deserializing the value. The
   * rawByteValue field is mainly provided for compatibility with attributes stored before the
   * introduction of the Attribute.Value.
   * @see #getRawByteValue()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeRawByteValue() {
    return com.google.api.client.util.Base64.decodeBase64(rawByteValue);
  }

  /**
   * Generally, applications should avoid storing raw bytes and instead store structured data as
   * protocol buffer extensions. This both reduces the amount of ad-hoc attribute parsing code as
   * well as eliminates an intermediate copy of the data when deserializing the value. The
   * rawByteValue field is mainly provided for compatibility with attributes stored before the
   * introduction of the Attribute.Value.
   * @see #encodeRawByteValue()
   * @param rawByteValue rawByteValue or {@code null} for none
   */
  public CaribouAttributeValue setRawByteValue(java.lang.String rawByteValue) {
    this.rawByteValue = rawByteValue;
    return this;
  }

  /**
   * Generally, applications should avoid storing raw bytes and instead store structured data as
   * protocol buffer extensions. This both reduces the amount of ad-hoc attribute parsing code as
   * well as eliminates an intermediate copy of the data when deserializing the value. The
   * rawByteValue field is mainly provided for compatibility with attributes stored before the
   * introduction of the Attribute.Value.
   * @see #setRawByteValue()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public CaribouAttributeValue encodeRawByteValue(byte[] rawByteValue) {
    this.rawByteValue = com.google.api.client.util.Base64.encodeBase64URLSafeString(rawByteValue);
    return this;
  }

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

  /**
   * @param stringValue stringValue or {@code null} for none
   */
  public CaribouAttributeValue setStringValue(java.lang.String stringValue) {
    this.stringValue = stringValue;
    return this;
  }

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

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

}
