<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datalabeling/v1beta1/dataset.proto

namespace Google\Cloud\DataLabeling\V1beta1;

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

/**
 * The configuration of input data, including data type, location, etc.
 *
 * Generated from protobuf message <code>google.cloud.datalabeling.v1beta1.InputConfig</code>
 */
class InputConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Data type must be specifed when user tries to import data.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.DataType data_type = 1;</code>
     */
    private $data_type = 0;
    /**
     * Optional. The type of annotation to be performed on this data. You must
     * specify this field if you are using this InputConfig in an
     * [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationType annotation_type = 3;</code>
     */
    private $annotation_type = 0;
    /**
     * Optional. Metadata about annotations for the input. You must specify this
     * field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a
     * model version that performs classification.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.ClassificationMetadata classification_metadata = 4;</code>
     */
    private $classification_metadata = null;
    protected $data_type_metadata;
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DataLabeling\V1beta1\TextMetadata $text_metadata
     *           Required for text import, as language code must be specified.
     *     @type \Google\Cloud\DataLabeling\V1beta1\GcsSource $gcs_source
     *           Source located in Cloud Storage.
     *     @type \Google\Cloud\DataLabeling\V1beta1\BigQuerySource $bigquery_source
     *           Source located in BigQuery. You must specify this field if you are using
     *           this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *     @type int $data_type
     *           Required. Data type must be specifed when user tries to import data.
     *     @type int $annotation_type
     *           Optional. The type of annotation to be performed on this data. You must
     *           specify this field if you are using this InputConfig in an
     *           [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *     @type \Google\Cloud\DataLabeling\V1beta1\ClassificationMetadata $classification_metadata
     *           Optional. Metadata about annotations for the input. You must specify this
     *           field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a
     *           model version that performs classification.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datalabeling\V1Beta1\Dataset::initOnce();
        parent::__construct($data);
    }

    /**
     * Required for text import, as language code must be specified.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.TextMetadata text_metadata = 6;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\TextMetadata|null
     */
    public function getTextMetadata()
    {
        return $this->readOneof(6);
    }

    public function hasTextMetadata()
    {
        return $this->hasOneof(6);
    }

    /**
     * Required for text import, as language code must be specified.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.TextMetadata text_metadata = 6;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\TextMetadata $var
     * @return $this
     */
    public function setTextMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\TextMetadata::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Source located in Cloud Storage.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.GcsSource gcs_source = 2;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\GcsSource|null
     */
    public function getGcsSource()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Source located in Cloud Storage.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.GcsSource gcs_source = 2;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\GcsSource $var
     * @return $this
     */
    public function setGcsSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\GcsSource::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Source located in BigQuery. You must specify this field if you are using
     * this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.BigQuerySource bigquery_source = 5;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\BigQuerySource|null
     */
    public function getBigquerySource()
    {
        return $this->readOneof(5);
    }

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

    /**
     * Source located in BigQuery. You must specify this field if you are using
     * this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.BigQuerySource bigquery_source = 5;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\BigQuerySource $var
     * @return $this
     */
    public function setBigquerySource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\BigQuerySource::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Required. Data type must be specifed when user tries to import data.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.DataType data_type = 1;</code>
     * @return int
     */
    public function getDataType()
    {
        return $this->data_type;
    }

    /**
     * Required. Data type must be specifed when user tries to import data.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.DataType data_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDataType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DataLabeling\V1beta1\DataType::class);
        $this->data_type = $var;

        return $this;
    }

    /**
     * Optional. The type of annotation to be performed on this data. You must
     * specify this field if you are using this InputConfig in an
     * [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationType annotation_type = 3;</code>
     * @return int
     */
    public function getAnnotationType()
    {
        return $this->annotation_type;
    }

    /**
     * Optional. The type of annotation to be performed on this data. You must
     * specify this field if you are using this InputConfig in an
     * [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob].
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationType annotation_type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setAnnotationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DataLabeling\V1beta1\AnnotationType::class);
        $this->annotation_type = $var;

        return $this;
    }

    /**
     * Optional. Metadata about annotations for the input. You must specify this
     * field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a
     * model version that performs classification.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.ClassificationMetadata classification_metadata = 4;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\ClassificationMetadata|null
     */
    public function getClassificationMetadata()
    {
        return $this->classification_metadata;
    }

    public function hasClassificationMetadata()
    {
        return isset($this->classification_metadata);
    }

    public function clearClassificationMetadata()
    {
        unset($this->classification_metadata);
    }

    /**
     * Optional. Metadata about annotations for the input. You must specify this
     * field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a
     * model version that performs classification.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.ClassificationMetadata classification_metadata = 4;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\ClassificationMetadata $var
     * @return $this
     */
    public function setClassificationMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\ClassificationMetadata::class);
        $this->classification_metadata = $var;

        return $this;
    }

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

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

}

