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

namespace Google\Cloud\AutoMl\V1beta1;

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

/**
 * Evaluation results of a model.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.ModelEvaluation</code>
 */
class ModelEvaluation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only.
     * Resource name of the model evaluation.
     * Format:
     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Output only.
     * The ID of the annotation spec that the model evaluation applies to. The
     * ID is empty for overall model evaluation.
     * NOTE: Currently there is no way to obtain the display_name of the
     * annotation spec from its ID. To see the display_names, review the model
     * evaluations in the UI.
     *
     * Generated from protobuf field <code>string annotation_spec_id = 2;</code>
     */
    private $annotation_spec_id = '';
    /**
     * Output only.
     * Timestamp when this model evaluation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    private $create_time = null;
    /**
     * Output only. The number of examples used for model evaluation.
     *
     * Generated from protobuf field <code>int32 evaluated_example_count = 6;</code>
     */
    private $evaluated_example_count = 0;
    protected $metrics;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics $classification_evaluation_metrics
     *           Evaluation metrics for models on classification problems models.
     *     @type \Google\Cloud\AutoMl\V1beta1\TranslationEvaluationMetrics $translation_evaluation_metrics
     *           Evaluation metrics for models on translation models.
     *     @type string $name
     *           Output only.
     *           Resource name of the model evaluation.
     *           Format:
     *           `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
     *     @type string $annotation_spec_id
     *           Output only.
     *           The ID of the annotation spec that the model evaluation applies to. The
     *           ID is empty for overall model evaluation.
     *           NOTE: Currently there is no way to obtain the display_name of the
     *           annotation spec from its ID. To see the display_names, review the model
     *           evaluations in the UI.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only.
     *           Timestamp when this model evaluation was created.
     *     @type int $evaluated_example_count
     *           Output only. The number of examples used for model evaluation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\ModelEvaluation::initOnce();
        parent::__construct($data);
    }

    /**
     * Evaluation metrics for models on classification problems models.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics
     */
    public function getClassificationEvaluationMetrics()
    {
        return $this->readOneof(8);
    }

    /**
     * Evaluation metrics for models on classification problems models.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics $var
     * @return $this
     */
    public function setClassificationEvaluationMetrics($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Evaluation metrics for models on translation models.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\TranslationEvaluationMetrics
     */
    public function getTranslationEvaluationMetrics()
    {
        return $this->readOneof(9);
    }

    /**
     * Evaluation metrics for models on translation models.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.TranslationEvaluationMetrics translation_evaluation_metrics = 9;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\TranslationEvaluationMetrics $var
     * @return $this
     */
    public function setTranslationEvaluationMetrics($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\TranslationEvaluationMetrics::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Output only.
     * Resource name of the model evaluation.
     * Format:
     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only.
     * Resource name of the model evaluation.
     * Format:
     * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only.
     * The ID of the annotation spec that the model evaluation applies to. The
     * ID is empty for overall model evaluation.
     * NOTE: Currently there is no way to obtain the display_name of the
     * annotation spec from its ID. To see the display_names, review the model
     * evaluations in the UI.
     *
     * Generated from protobuf field <code>string annotation_spec_id = 2;</code>
     * @return string
     */
    public function getAnnotationSpecId()
    {
        return $this->annotation_spec_id;
    }

    /**
     * Output only.
     * The ID of the annotation spec that the model evaluation applies to. The
     * ID is empty for overall model evaluation.
     * NOTE: Currently there is no way to obtain the display_name of the
     * annotation spec from its ID. To see the display_names, review the model
     * evaluations in the UI.
     *
     * Generated from protobuf field <code>string annotation_spec_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAnnotationSpecId($var)
    {
        GPBUtil::checkString($var, True);
        $this->annotation_spec_id = $var;

        return $this;
    }

    /**
     * Output only.
     * Timestamp when this model evaluation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    /**
     * Output only.
     * Timestamp when this model evaluation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The number of examples used for model evaluation.
     *
     * Generated from protobuf field <code>int32 evaluated_example_count = 6;</code>
     * @return int
     */
    public function getEvaluatedExampleCount()
    {
        return $this->evaluated_example_count;
    }

    /**
     * Output only. The number of examples used for model evaluation.
     *
     * Generated from protobuf field <code>int32 evaluated_example_count = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setEvaluatedExampleCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->evaluated_example_count = $var;

        return $this;
    }

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

}

