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

/**
 * Used as Mustang attachment DO NOT: - ACCESS THE PROTO FIELDS DIRECTLY - USE THE DECODING LIBRARY
 * IN quality/rankembed/mustang/fixed_point_decoding_helpers.h INSTEAD. - USE HARDCODED
 * MustangRankEmbedInfo TEXT PROTOS IN TESTS! USE
 * quality/rankembed/test_utils/mustang_rankembed_info_utils.h INSTEAD.
 *
 * <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 QualityRankembedMustangMustangRankEmbedInfo extends com.google.api.client.json.GenericJson {

  /**
   * Each of the repeated elements in this field has the same scheme as 'fixed_point_encoding'; See
   * go/rankembed-astro-rule-set-dd
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> additionalFixedPointEncodings;

  /**
   * Each uint64 encodes 8 8-bit values for the quantized document embedding
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private QualityRankembedMustangMustangRankEmbedInfoCompressedEmbedding compressedDocumentEmbedding;

  /**
   * This field replaces the above 3 "per-encoding-type-fields", where the encoding type (and the
   * embedding type) are part of the encoding, and is stored in the first byte. The remaining bytes
   * are the same as the previous 3 fields, but shifted by 1 byte. - byte[0]: encoding type &
   * embedding type - byte[1....]: similar to the above depending on the encoding type.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String fixedPointEncoding;

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per 2 values
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String scaledFixedPoint4Encoding;

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per value
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String scaledFixedPoint8Encoding;

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5...8]: shift - bytes[9,...]: the values, one
   * byte per 2 values
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String scaledShiftedFixedPoint4Encoding;

  /**
   * First 7 bits encode the version, then each chunk of 5 bits encode the index of a potential
   * improv query (lsb to msb) -------|-----|-----|-----|-----|----- version| id1 | id2 | id3 | id4
   * | id5 where id1 is the index of the first improv query in the improv debug table. As of
   * cl/270008220, this field only contains the version info. For backward compatibility, version
   * still only uses the first 7 bits, and is still prepended by 5 1 bits.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long versionAndImprovInfo;

  /**
   * Each of the repeated elements in this field has the same scheme as 'fixed_point_encoding'; See
   * go/rankembed-astro-rule-set-dd
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getAdditionalFixedPointEncodings() {
    return additionalFixedPointEncodings;
  }

  /**
   * Each of the repeated elements in this field has the same scheme as 'fixed_point_encoding'; See
   * go/rankembed-astro-rule-set-dd
   * @param additionalFixedPointEncodings additionalFixedPointEncodings or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setAdditionalFixedPointEncodings(java.util.List<java.lang.String> additionalFixedPointEncodings) {
    this.additionalFixedPointEncodings = additionalFixedPointEncodings;
    return this;
  }

  /**
   * Each uint64 encodes 8 8-bit values for the quantized document embedding
   * @return value or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfoCompressedEmbedding getCompressedDocumentEmbedding() {
    return compressedDocumentEmbedding;
  }

  /**
   * Each uint64 encodes 8 8-bit values for the quantized document embedding
   * @param compressedDocumentEmbedding compressedDocumentEmbedding or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setCompressedDocumentEmbedding(QualityRankembedMustangMustangRankEmbedInfoCompressedEmbedding compressedDocumentEmbedding) {
    this.compressedDocumentEmbedding = compressedDocumentEmbedding;
    return this;
  }

  /**
   * This field replaces the above 3 "per-encoding-type-fields", where the encoding type (and the
   * embedding type) are part of the encoding, and is stored in the first byte. The remaining bytes
   * are the same as the previous 3 fields, but shifted by 1 byte. - byte[0]: encoding type &
   * embedding type - byte[1....]: similar to the above depending on the encoding type.
   * @see #decodeFixedPointEncoding()
   * @return value or {@code null} for none
   */
  public java.lang.String getFixedPointEncoding() {
    return fixedPointEncoding;
  }

  /**
   * This field replaces the above 3 "per-encoding-type-fields", where the encoding type (and the
   * embedding type) are part of the encoding, and is stored in the first byte. The remaining bytes
   * are the same as the previous 3 fields, but shifted by 1 byte. - byte[0]: encoding type &
   * embedding type - byte[1....]: similar to the above depending on the encoding type.
   * @see #getFixedPointEncoding()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeFixedPointEncoding() {
    return com.google.api.client.util.Base64.decodeBase64(fixedPointEncoding);
  }

  /**
   * This field replaces the above 3 "per-encoding-type-fields", where the encoding type (and the
   * embedding type) are part of the encoding, and is stored in the first byte. The remaining bytes
   * are the same as the previous 3 fields, but shifted by 1 byte. - byte[0]: encoding type &
   * embedding type - byte[1....]: similar to the above depending on the encoding type.
   * @see #encodeFixedPointEncoding()
   * @param fixedPointEncoding fixedPointEncoding or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setFixedPointEncoding(java.lang.String fixedPointEncoding) {
    this.fixedPointEncoding = fixedPointEncoding;
    return this;
  }

  /**
   * This field replaces the above 3 "per-encoding-type-fields", where the encoding type (and the
   * embedding type) are part of the encoding, and is stored in the first byte. The remaining bytes
   * are the same as the previous 3 fields, but shifted by 1 byte. - byte[0]: encoding type &
   * embedding type - byte[1....]: similar to the above depending on the encoding type.
   * @see #setFixedPointEncoding()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public QualityRankembedMustangMustangRankEmbedInfo encodeFixedPointEncoding(byte[] fixedPointEncoding) {
    this.fixedPointEncoding = com.google.api.client.util.Base64.encodeBase64URLSafeString(fixedPointEncoding);
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per 2 values
   * @see #decodeScaledFixedPoint4Encoding()
   * @return value or {@code null} for none
   */
  public java.lang.String getScaledFixedPoint4Encoding() {
    return scaledFixedPoint4Encoding;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per 2 values
   * @see #getScaledFixedPoint4Encoding()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeScaledFixedPoint4Encoding() {
    return com.google.api.client.util.Base64.decodeBase64(scaledFixedPoint4Encoding);
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per 2 values
   * @see #encodeScaledFixedPoint4Encoding()
   * @param scaledFixedPoint4Encoding scaledFixedPoint4Encoding or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setScaledFixedPoint4Encoding(java.lang.String scaledFixedPoint4Encoding) {
    this.scaledFixedPoint4Encoding = scaledFixedPoint4Encoding;
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per 2 values
   * @see #setScaledFixedPoint4Encoding()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public QualityRankembedMustangMustangRankEmbedInfo encodeScaledFixedPoint4Encoding(byte[] scaledFixedPoint4Encoding) {
    this.scaledFixedPoint4Encoding = com.google.api.client.util.Base64.encodeBase64URLSafeString(scaledFixedPoint4Encoding);
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per value
   * @see #decodeScaledFixedPoint8Encoding()
   * @return value or {@code null} for none
   */
  public java.lang.String getScaledFixedPoint8Encoding() {
    return scaledFixedPoint8Encoding;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per value
   * @see #getScaledFixedPoint8Encoding()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeScaledFixedPoint8Encoding() {
    return com.google.api.client.util.Base64.decodeBase64(scaledFixedPoint8Encoding);
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per value
   * @see #encodeScaledFixedPoint8Encoding()
   * @param scaledFixedPoint8Encoding scaledFixedPoint8Encoding or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setScaledFixedPoint8Encoding(java.lang.String scaledFixedPoint8Encoding) {
    this.scaledFixedPoint8Encoding = scaledFixedPoint8Encoding;
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5,...]: the values, one byte per value
   * @see #setScaledFixedPoint8Encoding()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public QualityRankembedMustangMustangRankEmbedInfo encodeScaledFixedPoint8Encoding(byte[] scaledFixedPoint8Encoding) {
    this.scaledFixedPoint8Encoding = com.google.api.client.util.Base64.encodeBase64URLSafeString(scaledFixedPoint8Encoding);
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5...8]: shift - bytes[9,...]: the values, one
   * byte per 2 values
   * @see #decodeScaledShiftedFixedPoint4Encoding()
   * @return value or {@code null} for none
   */
  public java.lang.String getScaledShiftedFixedPoint4Encoding() {
    return scaledShiftedFixedPoint4Encoding;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5...8]: shift - bytes[9,...]: the values, one
   * byte per 2 values
   * @see #getScaledShiftedFixedPoint4Encoding()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeScaledShiftedFixedPoint4Encoding() {
    return com.google.api.client.util.Base64.decodeBase64(scaledShiftedFixedPoint4Encoding);
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5...8]: shift - bytes[9,...]: the values, one
   * byte per 2 values
   * @see #encodeScaledShiftedFixedPoint4Encoding()
   * @param scaledShiftedFixedPoint4Encoding scaledShiftedFixedPoint4Encoding or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setScaledShiftedFixedPoint4Encoding(java.lang.String scaledShiftedFixedPoint4Encoding) {
    this.scaledShiftedFixedPoint4Encoding = scaledShiftedFixedPoint4Encoding;
    return this;
  }

  /**
   * - byte[0]: version - bytes[1...4]: scalar - bytes[5...8]: shift - bytes[9,...]: the values, one
   * byte per 2 values
   * @see #setScaledShiftedFixedPoint4Encoding()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public QualityRankembedMustangMustangRankEmbedInfo encodeScaledShiftedFixedPoint4Encoding(byte[] scaledShiftedFixedPoint4Encoding) {
    this.scaledShiftedFixedPoint4Encoding = com.google.api.client.util.Base64.encodeBase64URLSafeString(scaledShiftedFixedPoint4Encoding);
    return this;
  }

  /**
   * First 7 bits encode the version, then each chunk of 5 bits encode the index of a potential
   * improv query (lsb to msb) -------|-----|-----|-----|-----|----- version| id1 | id2 | id3 | id4
   * | id5 where id1 is the index of the first improv query in the improv debug table. As of
   * cl/270008220, this field only contains the version info. For backward compatibility, version
   * still only uses the first 7 bits, and is still prepended by 5 1 bits.
   * @return value or {@code null} for none
   */
  public java.lang.Long getVersionAndImprovInfo() {
    return versionAndImprovInfo;
  }

  /**
   * First 7 bits encode the version, then each chunk of 5 bits encode the index of a potential
   * improv query (lsb to msb) -------|-----|-----|-----|-----|----- version| id1 | id2 | id3 | id4
   * | id5 where id1 is the index of the first improv query in the improv debug table. As of
   * cl/270008220, this field only contains the version info. For backward compatibility, version
   * still only uses the first 7 bits, and is still prepended by 5 1 bits.
   * @param versionAndImprovInfo versionAndImprovInfo or {@code null} for none
   */
  public QualityRankembedMustangMustangRankEmbedInfo setVersionAndImprovInfo(java.lang.Long versionAndImprovInfo) {
    this.versionAndImprovInfo = versionAndImprovInfo;
    return this;
  }

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

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

}
