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

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * Request message for
 * [SearchTuningService.TrainCustomModel][google.cloud.discoveryengine.v1.SearchTuningService.TrainCustomModel]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.TrainCustomModelRequest</code>
 */
class TrainCustomModelRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the Data Store, such as
     * `projects/&#42;&#47;locations/global/collections/default_collection/dataStores/default_data_store`.
     * This field is used to identify the data store where to train the models.
     *
     * Generated from protobuf field <code>string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $data_store = '';
    /**
     * Model to be trained. Supported values are:
     *  * **search-tuning**: Fine tuning the search system based on data provided.
     *
     * Generated from protobuf field <code>string model_type = 3;</code>
     */
    protected $model_type = '';
    /**
     * The desired location of errors incurred during the data ingestion and
     * training.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.ImportErrorConfig error_config = 4;</code>
     */
    protected $error_config = null;
    /**
     * If not provided, a UUID will be generated.
     *
     * Generated from protobuf field <code>string model_id = 5;</code>
     */
    protected $model_id = '';
    protected $training_input;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1\TrainCustomModelRequest\GcsTrainingInput $gcs_training_input
     *           Cloud Storage training input.
     *     @type string $data_store
     *           Required. The resource name of the Data Store, such as
     *           `projects/&#42;&#47;locations/global/collections/default_collection/dataStores/default_data_store`.
     *           This field is used to identify the data store where to train the models.
     *     @type string $model_type
     *           Model to be trained. Supported values are:
     *            * **search-tuning**: Fine tuning the search system based on data provided.
     *     @type \Google\Cloud\DiscoveryEngine\V1\ImportErrorConfig $error_config
     *           The desired location of errors incurred during the data ingestion and
     *           training.
     *     @type string $model_id
     *           If not provided, a UUID will be generated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\SearchTuningService::initOnce();
        parent::__construct($data);
    }

    /**
     * Cloud Storage training input.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInput gcs_training_input = 2;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\TrainCustomModelRequest\GcsTrainingInput|null
     */
    public function getGcsTrainingInput()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Cloud Storage training input.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInput gcs_training_input = 2;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\TrainCustomModelRequest\GcsTrainingInput $var
     * @return $this
     */
    public function setGcsTrainingInput($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\TrainCustomModelRequest\GcsTrainingInput::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Required. The resource name of the Data Store, such as
     * `projects/&#42;&#47;locations/global/collections/default_collection/dataStores/default_data_store`.
     * This field is used to identify the data store where to train the models.
     *
     * Generated from protobuf field <code>string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getDataStore()
    {
        return $this->data_store;
    }

    /**
     * Required. The resource name of the Data Store, such as
     * `projects/&#42;&#47;locations/global/collections/default_collection/dataStores/default_data_store`.
     * This field is used to identify the data store where to train the models.
     *
     * Generated from protobuf field <code>string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setDataStore($var)
    {
        GPBUtil::checkString($var, True);
        $this->data_store = $var;

        return $this;
    }

    /**
     * Model to be trained. Supported values are:
     *  * **search-tuning**: Fine tuning the search system based on data provided.
     *
     * Generated from protobuf field <code>string model_type = 3;</code>
     * @return string
     */
    public function getModelType()
    {
        return $this->model_type;
    }

    /**
     * Model to be trained. Supported values are:
     *  * **search-tuning**: Fine tuning the search system based on data provided.
     *
     * Generated from protobuf field <code>string model_type = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setModelType($var)
    {
        GPBUtil::checkString($var, True);
        $this->model_type = $var;

        return $this;
    }

    /**
     * The desired location of errors incurred during the data ingestion and
     * training.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.ImportErrorConfig error_config = 4;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\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 data ingestion and
     * training.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.ImportErrorConfig error_config = 4;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\ImportErrorConfig $var
     * @return $this
     */
    public function setErrorConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\ImportErrorConfig::class);
        $this->error_config = $var;

        return $this;
    }

    /**
     * If not provided, a UUID will be generated.
     *
     * Generated from protobuf field <code>string model_id = 5;</code>
     * @return string
     */
    public function getModelId()
    {
        return $this->model_id;
    }

    /**
     * If not provided, a UUID will be generated.
     *
     * Generated from protobuf field <code>string model_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setModelId($var)
    {
        GPBUtil::checkString($var, True);
        $this->model_id = $var;

        return $this;
    }

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

}

