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

namespace Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail;

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

/**
 * Aggregated result on metric level. This conatins the evaluation results
 * of all the sections.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail</code>
 */
class MetricDetail extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Metrics name. e.g. accuracy, adherence, completeness.
     *
     * Generated from protobuf field <code>string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $metric = '';
    /**
     * Output only. Aggregated(average) score on this metric across all
     * sections.
     *
     * Generated from protobuf field <code>optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $score = null;
    /**
     * Output only. List of section details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $section_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $metric
     *           Output only. Metrics name. e.g. accuracy, adherence, completeness.
     *     @type float $score
     *           Output only. Aggregated(average) score on this metric across all
     *           sections.
     *     @type \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail[] $section_details
     *           Output only. List of section details.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\GeneratorEvaluation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Metrics name. e.g. accuracy, adherence, completeness.
     *
     * Generated from protobuf field <code>string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getMetric()
    {
        return $this->metric;
    }

    /**
     * Output only. Metrics name. e.g. accuracy, adherence, completeness.
     *
     * Generated from protobuf field <code>string metric = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setMetric($var)
    {
        GPBUtil::checkString($var, True);
        $this->metric = $var;

        return $this;
    }

    /**
     * Output only. Aggregated(average) score on this metric across all
     * sections.
     *
     * Generated from protobuf field <code>optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return float
     */
    public function getScore()
    {
        return isset($this->score) ? $this->score : 0.0;
    }

    public function hasScore()
    {
        return isset($this->score);
    }

    public function clearScore()
    {
        unset($this->score);
    }

    /**
     * Output only. Aggregated(average) score on this metric across all
     * sections.
     *
     * Generated from protobuf field <code>optional float score = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param float $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->score = $var;

        return $this;
    }

    /**
     * Output only. List of section details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return RepeatedField<\Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail>
     */
    public function getSectionDetails()
    {
        return $this->section_details;
    }

    /**
     * Output only. List of section details.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail section_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail[] $var
     * @return $this
     */
    public function setSectionDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationEvaluationMetrics\ConversationDetail\MetricDetail\SectionDetail::class);
        $this->section_details = $arr;

        return $this;
    }

}

