<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/discoveryengine/v1beta/import_config.proto

namespace Google\Cloud\DiscoveryEngine\V1beta;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Request message for Import methods.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.ImportDocumentsRequest</code>
 */
class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent branch resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
     * Requires create/update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportErrorConfig error_config = 5;</code>
     */
    protected $error_config = null;
    /**
     * The mode of reconciliation between existing documents and the documents to
     * be imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6;</code>
     */
    protected $reconciliation_mode = 0;
    /**
     * Whether to automatically generate IDs for the documents if absent.
     * If set to `true`,
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
     * automatically generated based on the hash of the payload, where IDs may not
     * be consistent during multiple imports. In which case
     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
     * is highly recommended to avoid duplicate contents. If unset or set to
     * `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
     * have to be specified using
     * [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
     * otherwises, documents without IDs will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
     *
     * Generated from protobuf field <code>bool auto_generate_ids = 8;</code>
     */
    protected $auto_generate_ids = false;
    /**
     * The field in the Cloud Storage and BigQuery sources that indicates the
     * unique IDs of the documents.
     * For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
     * "some_uuid"}`. For
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.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 will be used as the
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. 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 will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom`. And only set this field when
     * [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.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.
     *
     * Generated from protobuf field <code>string id_field = 9;</code>
     */
    protected $id_field = '';
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\ImportDocumentsRequest\InlineSource $inline_source
     *           The Inline source for the input content for documents.
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\GcsSource $gcs_source
     *           Cloud Storage location for the input content.
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\BigQuerySource $bigquery_source
     *           BigQuery input source.
     *     @type string $parent
     *           Required. The parent branch resource name, such as
     *           `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
     *           Requires create/update permission.
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\ImportErrorConfig $error_config
     *           The desired location of errors incurred during the Import.
     *     @type int $reconciliation_mode
     *           The mode of reconciliation between existing documents and the documents to
     *           be imported. Defaults to
     *           [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
     *     @type bool $auto_generate_ids
     *           Whether to automatically generate IDs for the documents if absent.
     *           If set to `true`,
     *           [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
     *           automatically generated based on the hash of the payload, where IDs may not
     *           be consistent during multiple imports. In which case
     *           [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
     *           is highly recommended to avoid duplicate contents. If unset or set to
     *           `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
     *           have to be specified using
     *           [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
     *           otherwises, documents without IDs will fail to be imported.
     *           Only set this field when using
     *           [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     *           [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     *           when
     *           [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     *           or
     *           [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     *           is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
     *     @type string $id_field
     *           The field in the Cloud Storage and BigQuery sources that indicates the
     *           unique IDs of the documents.
     *           For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
     *           key of the JSON field. For instance, `my_id` for JSON `{"my_id":
     *           "some_uuid"}`. For
     *           [BigQuerySource][google.cloud.discoveryengine.v1beta.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 will be used as the
     *           [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. 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 will fail to be imported.
     *           Only set this field when using
     *           [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     *           [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     *           when
     *           [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     *           or
     *           [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     *           is `custom`. And only set this field when
     *           [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.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.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\ImportConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The Inline source for the input content for documents.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.InlineSource inline_source = 2;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\ImportDocumentsRequest\InlineSource|null
     */
    public function getInlineSource()
    {
        return $this->readOneof(2);
    }

    public function hasInlineSource()
    {
        return $this->hasOneof(2);
    }

    /**
     * The Inline source for the input content for documents.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.InlineSource inline_source = 2;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\ImportDocumentsRequest\InlineSource $var
     * @return $this
     */
    public function setInlineSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\ImportDocumentsRequest\InlineSource::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Cloud Storage location for the input content.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.GcsSource gcs_source = 3;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\GcsSource|null
     */
    public function getGcsSource()
    {
        return $this->readOneof(3);
    }

    public function hasGcsSource()
    {
        return $this->hasOneof(3);
    }

    /**
     * Cloud Storage location for the input content.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.GcsSource gcs_source = 3;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\GcsSource $var
     * @return $this
     */
    public function setGcsSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\GcsSource::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * BigQuery input source.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.BigQuerySource bigquery_source = 4;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\BigQuerySource|null
     */
    public function getBigquerySource()
    {
        return $this->readOneof(4);
    }

    public function hasBigquerySource()
    {
        return $this->hasOneof(4);
    }

    /**
     * BigQuery input source.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.BigQuerySource bigquery_source = 4;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\BigQuerySource $var
     * @return $this
     */
    public function setBigquerySource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\BigQuerySource::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Required. The parent branch resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
     * Requires create/update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The parent branch resource name, such as
     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
     * Requires create/update permission.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportErrorConfig error_config = 5;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\ImportErrorConfig|null
     */
    public function getErrorConfig()
    {
        return $this->error_config;
    }

    public function hasErrorConfig()
    {
        return isset($this->error_config);
    }

    public function clearErrorConfig()
    {
        unset($this->error_config);
    }

    /**
     * The desired location of errors incurred during the Import.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportErrorConfig error_config = 5;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\ImportErrorConfig $var
     * @return $this
     */
    public function setErrorConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\ImportErrorConfig::class);
        $this->error_config = $var;

        return $this;
    }

    /**
     * The mode of reconciliation between existing documents and the documents to
     * be imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6;</code>
     * @return int
     */
    public function getReconciliationMode()
    {
        return $this->reconciliation_mode;
    }

    /**
     * The mode of reconciliation between existing documents and the documents to
     * be imported. Defaults to
     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setReconciliationMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1beta\ImportDocumentsRequest\ReconciliationMode::class);
        $this->reconciliation_mode = $var;

        return $this;
    }

    /**
     * Whether to automatically generate IDs for the documents if absent.
     * If set to `true`,
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
     * automatically generated based on the hash of the payload, where IDs may not
     * be consistent during multiple imports. In which case
     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
     * is highly recommended to avoid duplicate contents. If unset or set to
     * `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
     * have to be specified using
     * [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
     * otherwises, documents without IDs will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
     *
     * Generated from protobuf field <code>bool auto_generate_ids = 8;</code>
     * @return bool
     */
    public function getAutoGenerateIds()
    {
        return $this->auto_generate_ids;
    }

    /**
     * Whether to automatically generate IDs for the documents if absent.
     * If set to `true`,
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
     * automatically generated based on the hash of the payload, where IDs may not
     * be consistent during multiple imports. In which case
     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
     * is highly recommended to avoid duplicate contents. If unset or set to
     * `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
     * have to be specified using
     * [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
     * otherwises, documents without IDs will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
     *
     * Generated from protobuf field <code>bool auto_generate_ids = 8;</code>
     * @param bool $var
     * @return $this
     */
    public function setAutoGenerateIds($var)
    {
        GPBUtil::checkBool($var);
        $this->auto_generate_ids = $var;

        return $this;
    }

    /**
     * The field in the Cloud Storage and BigQuery sources that indicates the
     * unique IDs of the documents.
     * For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
     * "some_uuid"}`. For
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.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 will be used as the
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. 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 will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom`. And only set this field when
     * [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.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.
     *
     * Generated from protobuf field <code>string id_field = 9;</code>
     * @return string
     */
    public function getIdField()
    {
        return $this->id_field;
    }

    /**
     * The field in the Cloud Storage and BigQuery sources that indicates the
     * unique IDs of the documents.
     * For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
     * "some_uuid"}`. For
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.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 will be used as the
     * [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. 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 will fail to be imported.
     * Only set this field when using
     * [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
     * [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
     * when
     * [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
     * or
     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
     * is `custom`. And only set this field when
     * [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.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.
     *
     * Generated from protobuf field <code>string id_field = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setIdField($var)
    {
        GPBUtil::checkString($var, True);
        $this->id_field = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSource()
    {
        return $this->whichOneof("source");
    }

}

