/*
 * 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.discoveryengine.v1beta.model;

/**
 * Request message for Import methods.
 *
 * <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 Discovery Engine 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 GoogleCloudDiscoveryengineV1betaImportDocumentsRequest extends com.google.api.client.json.GenericJson {

  /**
   * Whether to automatically generate IDs for the documents if absent. If set to `true`,
   * Document.ids are automatically generated based on the hash of the payload, where IDs may not be
   * consistent during multiple imports. In which case ReconciliationMode.FULL is highly recommended
   * to avoid duplicate contents. If unset or set to `false`, Document.ids have to be specified
   * using id_field, otherwise, documents without IDs fail to be imported. Only set this field when
   * using GcsSource or BigQuerySource, and when GcsSource.data_schema or BigQuerySource.data_schema
   * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean autoGenerateIds;

  /**
   * BigQuery input source.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1betaBigQuerySource bigquerySource;

  /**
   * The desired location of errors incurred during the Import.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1betaImportErrorConfig errorConfig;

  /**
   * Cloud Storage location for the input content.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1betaGcsSource gcsSource;

  /**
   * The field in the Cloud Storage and BigQuery sources that indicates the unique IDs of the
   * documents. For GcsSource it is the key of the JSON field. For instance, `my_id` for JSON
   * `{"my_id": "some_uuid"}`. For BigQuerySource it is the column name of the BigQuery table where
   * the unique ids are stored. The values of the JSON field or the BigQuery column are used as the
   * Document.ids. The JSON field or the BigQuery column must be of string type, and the values must
   * be set as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63
   * characters. Otherwise, documents without valid IDs fail to be imported. Only set this field
   * when using GcsSource or BigQuerySource, and when GcsSource.data_schema or
   * BigQuerySource.data_schema is `custom`. And only set this field when auto_generate_ids is unset
   * or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a default
   * value `_id` is used when importing from the allowed data sources.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String idField;

  /**
   * The Inline source for the input content for documents.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource inlineSource;

  /**
   * The mode of reconciliation between existing documents and the documents to be imported.
   * Defaults to ReconciliationMode.INCREMENTAL.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String reconciliationMode;

  /**
   * Whether to automatically generate IDs for the documents if absent. If set to `true`,
   * Document.ids are automatically generated based on the hash of the payload, where IDs may not be
   * consistent during multiple imports. In which case ReconciliationMode.FULL is highly recommended
   * to avoid duplicate contents. If unset or set to `false`, Document.ids have to be specified
   * using id_field, otherwise, documents without IDs fail to be imported. Only set this field when
   * using GcsSource or BigQuerySource, and when GcsSource.data_schema or BigQuerySource.data_schema
   * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getAutoGenerateIds() {
    return autoGenerateIds;
  }

  /**
   * Whether to automatically generate IDs for the documents if absent. If set to `true`,
   * Document.ids are automatically generated based on the hash of the payload, where IDs may not be
   * consistent during multiple imports. In which case ReconciliationMode.FULL is highly recommended
   * to avoid duplicate contents. If unset or set to `false`, Document.ids have to be specified
   * using id_field, otherwise, documents without IDs fail to be imported. Only set this field when
   * using GcsSource or BigQuerySource, and when GcsSource.data_schema or BigQuerySource.data_schema
   * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
   * @param autoGenerateIds autoGenerateIds or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setAutoGenerateIds(java.lang.Boolean autoGenerateIds) {
    this.autoGenerateIds = autoGenerateIds;
    return this;
  }

  /**
   * BigQuery input source.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaBigQuerySource getBigquerySource() {
    return bigquerySource;
  }

  /**
   * BigQuery input source.
   * @param bigquerySource bigquerySource or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setBigquerySource(GoogleCloudDiscoveryengineV1betaBigQuerySource bigquerySource) {
    this.bigquerySource = bigquerySource;
    return this;
  }

  /**
   * The desired location of errors incurred during the Import.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportErrorConfig getErrorConfig() {
    return errorConfig;
  }

  /**
   * The desired location of errors incurred during the Import.
   * @param errorConfig errorConfig or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setErrorConfig(GoogleCloudDiscoveryengineV1betaImportErrorConfig errorConfig) {
    this.errorConfig = errorConfig;
    return this;
  }

  /**
   * Cloud Storage location for the input content.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaGcsSource getGcsSource() {
    return gcsSource;
  }

  /**
   * Cloud Storage location for the input content.
   * @param gcsSource gcsSource or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setGcsSource(GoogleCloudDiscoveryengineV1betaGcsSource gcsSource) {
    this.gcsSource = gcsSource;
    return this;
  }

  /**
   * The field in the Cloud Storage and BigQuery sources that indicates the unique IDs of the
   * documents. For GcsSource it is the key of the JSON field. For instance, `my_id` for JSON
   * `{"my_id": "some_uuid"}`. For BigQuerySource it is the column name of the BigQuery table where
   * the unique ids are stored. The values of the JSON field or the BigQuery column are used as the
   * Document.ids. The JSON field or the BigQuery column must be of string type, and the values must
   * be set as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63
   * characters. Otherwise, documents without valid IDs fail to be imported. Only set this field
   * when using GcsSource or BigQuerySource, and when GcsSource.data_schema or
   * BigQuerySource.data_schema is `custom`. And only set this field when auto_generate_ids is unset
   * or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a default
   * value `_id` is used when importing from the allowed data sources.
   * @return value or {@code null} for none
   */
  public java.lang.String getIdField() {
    return idField;
  }

  /**
   * The field in the Cloud Storage and BigQuery sources that indicates the unique IDs of the
   * documents. For GcsSource it is the key of the JSON field. For instance, `my_id` for JSON
   * `{"my_id": "some_uuid"}`. For BigQuerySource it is the column name of the BigQuery table where
   * the unique ids are stored. The values of the JSON field or the BigQuery column are used as the
   * Document.ids. The JSON field or the BigQuery column must be of string type, and the values must
   * be set as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63
   * characters. Otherwise, documents without valid IDs fail to be imported. Only set this field
   * when using GcsSource or BigQuerySource, and when GcsSource.data_schema or
   * BigQuerySource.data_schema is `custom`. And only set this field when auto_generate_ids is unset
   * or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a default
   * value `_id` is used when importing from the allowed data sources.
   * @param idField idField or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setIdField(java.lang.String idField) {
    this.idField = idField;
    return this;
  }

  /**
   * The Inline source for the input content for documents.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource getInlineSource() {
    return inlineSource;
  }

  /**
   * The Inline source for the input content for documents.
   * @param inlineSource inlineSource or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setInlineSource(GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource inlineSource) {
    this.inlineSource = inlineSource;
    return this;
  }

  /**
   * The mode of reconciliation between existing documents and the documents to be imported.
   * Defaults to ReconciliationMode.INCREMENTAL.
   * @return value or {@code null} for none
   */
  public java.lang.String getReconciliationMode() {
    return reconciliationMode;
  }

  /**
   * The mode of reconciliation between existing documents and the documents to be imported.
   * Defaults to ReconciliationMode.INCREMENTAL.
   * @param reconciliationMode reconciliationMode or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1betaImportDocumentsRequest setReconciliationMode(java.lang.String reconciliationMode) {
    this.reconciliationMode = reconciliationMode;
    return this;
  }

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

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

}
