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

namespace Google\Cloud\ContactCenterInsights\V1;

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

/**
 * The results of scoring a single conversation against a QaScorecard. Contains
 * a collection of QaAnswers and aggregate score.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.QaScorecardResult</code>
 */
class QaScorecardResult extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The name of the scorecard result.
     * Format:
     * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * The QaScorecardRevision scored by this result.
     *
     * Generated from protobuf field <code>string qa_scorecard_revision = 2 [(.google.api.resource_reference) = {</code>
     */
    protected $qa_scorecard_revision = '';
    /**
     * The conversation scored by this result.
     *
     * Generated from protobuf field <code>string conversation = 3 [(.google.api.resource_reference) = {</code>
     */
    protected $conversation = '';
    /**
     * Output only. The timestamp that the revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * ID of the agent that handled the conversation.
     *
     * Generated from protobuf field <code>string agent_id = 5;</code>
     */
    protected $agent_id = '';
    /**
     * Set of QaAnswers represented in the result.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6;</code>
     */
    private $qa_answers;
    /**
     * The overall numerical score of the result, incorporating any manual edits
     * if they exist.
     *
     * Generated from protobuf field <code>optional double score = 7;</code>
     */
    protected $score = null;
    /**
     * The maximum potential overall score of the scorecard. Any questions
     * answered using `na_value` are excluded from this calculation.
     *
     * Generated from protobuf field <code>optional double potential_score = 8;</code>
     */
    protected $potential_score = null;
    /**
     * The normalized score, which is the score divided by the potential score.
     * Any manual edits are included if they exist.
     *
     * Generated from protobuf field <code>optional double normalized_score = 9;</code>
     */
    protected $normalized_score = null;
    /**
     * Collection of tags and their scores.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10;</code>
     */
    private $qa_tag_results;
    /**
     * List of all individual score sets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11;</code>
     */
    private $score_sources;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The name of the scorecard result.
     *           Format:
     *           projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}
     *     @type string $qa_scorecard_revision
     *           The QaScorecardRevision scored by this result.
     *     @type string $conversation
     *           The conversation scored by this result.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp that the revision was created.
     *     @type string $agent_id
     *           ID of the agent that handled the conversation.
     *     @type \Google\Cloud\ContactCenterInsights\V1\QaAnswer[] $qa_answers
     *           Set of QaAnswers represented in the result.
     *     @type float $score
     *           The overall numerical score of the result, incorporating any manual edits
     *           if they exist.
     *     @type float $potential_score
     *           The maximum potential overall score of the scorecard. Any questions
     *           answered using `na_value` are excluded from this calculation.
     *     @type float $normalized_score
     *           The normalized score, which is the score divided by the potential score.
     *           Any manual edits are included if they exist.
     *     @type \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult[] $qa_tag_results
     *           Collection of tags and their scores.
     *     @type \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource[] $score_sources
     *           List of all individual score sets.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The name of the scorecard result.
     * Format:
     * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The name of the scorecard result.
     * Format:
     * projects/{project}/locations/{location}/qaScorecardResults/{qa_scorecard_result}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The QaScorecardRevision scored by this result.
     *
     * Generated from protobuf field <code>string qa_scorecard_revision = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getQaScorecardRevision()
    {
        return $this->qa_scorecard_revision;
    }

    /**
     * The QaScorecardRevision scored by this result.
     *
     * Generated from protobuf field <code>string qa_scorecard_revision = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setQaScorecardRevision($var)
    {
        GPBUtil::checkString($var, True);
        $this->qa_scorecard_revision = $var;

        return $this;
    }

    /**
     * The conversation scored by this result.
     *
     * Generated from protobuf field <code>string conversation = 3 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getConversation()
    {
        return $this->conversation;
    }

    /**
     * The conversation scored by this result.
     *
     * Generated from protobuf field <code>string conversation = 3 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setConversation($var)
    {
        GPBUtil::checkString($var, True);
        $this->conversation = $var;

        return $this;
    }

    /**
     * Output only. The timestamp that the revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The timestamp that the revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
    }

    /**
     * ID of the agent that handled the conversation.
     *
     * Generated from protobuf field <code>string agent_id = 5;</code>
     * @return string
     */
    public function getAgentId()
    {
        return $this->agent_id;
    }

    /**
     * ID of the agent that handled the conversation.
     *
     * Generated from protobuf field <code>string agent_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setAgentId($var)
    {
        GPBUtil::checkString($var, True);
        $this->agent_id = $var;

        return $this;
    }

    /**
     * Set of QaAnswers represented in the result.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6;</code>
     * @return RepeatedField<\Google\Cloud\ContactCenterInsights\V1\QaAnswer>
     */
    public function getQaAnswers()
    {
        return $this->qa_answers;
    }

    /**
     * Set of QaAnswers represented in the result.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer qa_answers = 6;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\QaAnswer[] $var
     * @return $this
     */
    public function setQaAnswers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaAnswer::class);
        $this->qa_answers = $arr;

        return $this;
    }

    /**
     * The overall numerical score of the result, incorporating any manual edits
     * if they exist.
     *
     * Generated from protobuf field <code>optional double score = 7;</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);
    }

    /**
     * The overall numerical score of the result, incorporating any manual edits
     * if they exist.
     *
     * Generated from protobuf field <code>optional double score = 7;</code>
     * @param float $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->score = $var;

        return $this;
    }

    /**
     * The maximum potential overall score of the scorecard. Any questions
     * answered using `na_value` are excluded from this calculation.
     *
     * Generated from protobuf field <code>optional double potential_score = 8;</code>
     * @return float
     */
    public function getPotentialScore()
    {
        return isset($this->potential_score) ? $this->potential_score : 0.0;
    }

    public function hasPotentialScore()
    {
        return isset($this->potential_score);
    }

    public function clearPotentialScore()
    {
        unset($this->potential_score);
    }

    /**
     * The maximum potential overall score of the scorecard. Any questions
     * answered using `na_value` are excluded from this calculation.
     *
     * Generated from protobuf field <code>optional double potential_score = 8;</code>
     * @param float $var
     * @return $this
     */
    public function setPotentialScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->potential_score = $var;

        return $this;
    }

    /**
     * The normalized score, which is the score divided by the potential score.
     * Any manual edits are included if they exist.
     *
     * Generated from protobuf field <code>optional double normalized_score = 9;</code>
     * @return float
     */
    public function getNormalizedScore()
    {
        return isset($this->normalized_score) ? $this->normalized_score : 0.0;
    }

    public function hasNormalizedScore()
    {
        return isset($this->normalized_score);
    }

    public function clearNormalizedScore()
    {
        unset($this->normalized_score);
    }

    /**
     * The normalized score, which is the score divided by the potential score.
     * Any manual edits are included if they exist.
     *
     * Generated from protobuf field <code>optional double normalized_score = 9;</code>
     * @param float $var
     * @return $this
     */
    public function setNormalizedScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->normalized_score = $var;

        return $this;
    }

    /**
     * Collection of tags and their scores.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10;</code>
     * @return RepeatedField<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult>
     */
    public function getQaTagResults()
    {
        return $this->qa_tag_results;
    }

    /**
     * Collection of tags and their scores.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.QaTagResult qa_tag_results = 10;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult[] $var
     * @return $this
     */
    public function setQaTagResults($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\QaTagResult::class);
        $this->qa_tag_results = $arr;

        return $this;
    }

    /**
     * List of all individual score sets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11;</code>
     * @return RepeatedField<\Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource>
     */
    public function getScoreSources()
    {
        return $this->score_sources;
    }

    /**
     * List of all individual score sets.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaScorecardResult.ScoreSource score_sources = 11;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource[] $var
     * @return $this
     */
    public function setScoreSources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaScorecardResult\ScoreSource::class);
        $this->score_sources = $arr;

        return $this;
    }

}

