<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/generator_evaluation.proto

namespace Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics;

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

/**
 * Evaluation result that contains one of accuracy, adherence or completeness
 * evaluation result.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult</code>
 */
class EvaluationResult extends \Google\Protobuf\Internal\Message
{
    protected $result;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $accuracy_decomposition
     *           Only available for accuracy metric.
     *     @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric $adherence_rubric
     *           Only available for adherence metric.
     *     @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric $completeness_rubric
     *           Only available for completeness metric.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce();
        parent::__construct($data);
    }

    /**
     * Only available for accuracy metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1;</code>
     * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition|null
     */
    public function getAccuracyDecomposition()
    {
        return $this->readOneof(1);
    }

    public function hasAccuracyDecomposition()
    {
        return $this->hasOneof(1);
    }

    /**
     * Only available for accuracy metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition accuracy_decomposition = 1;</code>
     * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition $var
     * @return $this
     */
    public function setAccuracyDecomposition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AccuracyDecomposition::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Only available for adherence metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric adherence_rubric = 2;</code>
     * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric|null
     */
    public function getAdherenceRubric()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Only available for adherence metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric adherence_rubric = 2;</code>
     * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric $var
     * @return $this
     */
    public function setAdherenceRubric($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\AdherenceRubric::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Only available for completeness metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric completeness_rubric = 3;</code>
     * @return \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric|null
     */
    public function getCompletenessRubric()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Only available for completeness metric.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric completeness_rubric = 3;</code>
     * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric $var
     * @return $this
     */
    public function setCompletenessRubric($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\CompletenessRubric::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

