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

namespace Google\Cloud\ContactCenterInsights\V1\QaAnswer;

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

/**
 * Message for holding the value of a
 * [QaAnswer][google.cloud.contactcenterinsights.v1.QaAnswer].
 * [QaQuestion.AnswerChoice][google.cloud.contactcenterinsights.v1.QaQuestion.AnswerChoice]
 * defines the possible answer values for a question.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue</code>
 */
class AnswerValue extends \Google\Protobuf\Internal\Message
{
    /**
     * A short string used as an identifier. Matches the value used in
     * QaQuestion.AnswerChoice.key.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     */
    protected $key = '';
    /**
     * Output only. Numerical score of the answer.
     *
     * Generated from protobuf field <code>optional double score = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $score = null;
    /**
     * Output only. The maximum potential score of the question.
     *
     * Generated from protobuf field <code>optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $potential_score = null;
    /**
     * Output only. Normalized score of the questions. Calculated as score /
     * potential_score.
     *
     * Generated from protobuf field <code>optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $normalized_score = null;
    protected $value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $str_value
     *           String value.
     *     @type float $num_value
     *           Numerical value.
     *     @type bool $bool_value
     *           Boolean value.
     *     @type bool $na_value
     *           A value of "Not Applicable (N/A)". Should only ever be `true`.
     *     @type string $key
     *           A short string used as an identifier. Matches the value used in
     *           QaQuestion.AnswerChoice.key.
     *     @type float $score
     *           Output only. Numerical score of the answer.
     *     @type float $potential_score
     *           Output only. The maximum potential score of the question.
     *     @type float $normalized_score
     *           Output only. Normalized score of the questions. Calculated as score /
     *           potential_score.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * String value.
     *
     * Generated from protobuf field <code>string str_value = 2;</code>
     * @return string
     */
    public function getStrValue()
    {
        return $this->readOneof(2);
    }

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

    /**
     * String value.
     *
     * Generated from protobuf field <code>string str_value = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setStrValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Numerical value.
     *
     * Generated from protobuf field <code>double num_value = 3;</code>
     * @return float
     */
    public function getNumValue()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Numerical value.
     *
     * Generated from protobuf field <code>double num_value = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setNumValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Boolean value.
     *
     * Generated from protobuf field <code>bool bool_value = 4;</code>
     * @return bool
     */
    public function getBoolValue()
    {
        return $this->readOneof(4);
    }

    public function hasBoolValue()
    {
        return $this->hasOneof(4);
    }

    /**
     * Boolean value.
     *
     * Generated from protobuf field <code>bool bool_value = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setBoolValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * A value of "Not Applicable (N/A)". Should only ever be `true`.
     *
     * Generated from protobuf field <code>bool na_value = 5;</code>
     * @return bool
     */
    public function getNaValue()
    {
        return $this->readOneof(5);
    }

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

    /**
     * A value of "Not Applicable (N/A)". Should only ever be `true`.
     *
     * Generated from protobuf field <code>bool na_value = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setNaValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * A short string used as an identifier. Matches the value used in
     * QaQuestion.AnswerChoice.key.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * A short string used as an identifier. Matches the value used in
     * QaQuestion.AnswerChoice.key.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * Output only. Numerical score of the answer.
     *
     * Generated from protobuf field <code>optional double score = 6 [(.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. Numerical score of the answer.
     *
     * Generated from protobuf field <code>optional double score = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param float $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->score = $var;

        return $this;
    }

    /**
     * Output only. The maximum potential score of the question.
     *
     * Generated from protobuf field <code>optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
    }

    /**
     * Output only. The maximum potential score of the question.
     *
     * Generated from protobuf field <code>optional double potential_score = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param float $var
     * @return $this
     */
    public function setPotentialScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->potential_score = $var;

        return $this;
    }

    /**
     * Output only. Normalized score of the questions. Calculated as score /
     * potential_score.
     *
     * Generated from protobuf field <code>optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
    }

    /**
     * Output only. Normalized score of the questions. Calculated as score /
     * potential_score.
     *
     * Generated from protobuf field <code>optional double normalized_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param float $var
     * @return $this
     */
    public function setNormalizedScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->normalized_score = $var;

        return $this;
    }

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

}

