<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * An answer to a QaQuestion.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.QaAnswer</code>
 */
class QaAnswer extends \Google\Protobuf\Internal\Message
{
    /**
     * The QaQuestion answered by this answer.
     *
     * Generated from protobuf field <code>string qa_question = 7 [(.google.api.resource_reference) = {</code>
     */
    protected $qa_question = '';
    /**
     * The conversation the answer applies to.
     *
     * Generated from protobuf field <code>string conversation = 2 [(.google.api.resource_reference) = {</code>
     */
    protected $conversation = '';
    /**
     * Question text. E.g., "Did the agent greet the customer?"
     *
     * Generated from protobuf field <code>string question_body = 6;</code>
     */
    protected $question_body = '';
    /**
     * The main answer value, incorporating any manual edits if they exist.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3;</code>
     */
    protected $answer_value = null;
    /**
     * User-defined list of arbitrary tags. Matches the value from
     * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and
     * for weighting the score of each answer.
     *
     * Generated from protobuf field <code>repeated string tags = 5;</code>
     */
    private $tags;
    /**
     * List of all individual answers given to the question.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8;</code>
     */
    private $answer_sources;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $qa_question
     *           The QaQuestion answered by this answer.
     *     @type string $conversation
     *           The conversation the answer applies to.
     *     @type string $question_body
     *           Question text. E.g., "Did the agent greet the customer?"
     *     @type \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $answer_value
     *           The main answer value, incorporating any manual edits if they exist.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $tags
     *           User-defined list of arbitrary tags. Matches the value from
     *           QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and
     *           for weighting the score of each answer.
     *     @type array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $answer_sources
     *           List of all individual answers given to the question.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * The QaQuestion answered by this answer.
     *
     * Generated from protobuf field <code>string qa_question = 7 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getQaQuestion()
    {
        return $this->qa_question;
    }

    /**
     * The QaQuestion answered by this answer.
     *
     * Generated from protobuf field <code>string qa_question = 7 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setQaQuestion($var)
    {
        GPBUtil::checkString($var, True);
        $this->qa_question = $var;

        return $this;
    }

    /**
     * The conversation the answer applies to.
     *
     * Generated from protobuf field <code>string conversation = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getConversation()
    {
        return $this->conversation;
    }

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

        return $this;
    }

    /**
     * Question text. E.g., "Did the agent greet the customer?"
     *
     * Generated from protobuf field <code>string question_body = 6;</code>
     * @return string
     */
    public function getQuestionBody()
    {
        return $this->question_body;
    }

    /**
     * Question text. E.g., "Did the agent greet the customer?"
     *
     * Generated from protobuf field <code>string question_body = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setQuestionBody($var)
    {
        GPBUtil::checkString($var, True);
        $this->question_body = $var;

        return $this;
    }

    /**
     * The main answer value, incorporating any manual edits if they exist.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3;</code>
     * @return \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue|null
     */
    public function getAnswerValue()
    {
        return $this->answer_value;
    }

    public function hasAnswerValue()
    {
        return isset($this->answer_value);
    }

    public function clearAnswerValue()
    {
        unset($this->answer_value);
    }

    /**
     * The main answer value, incorporating any manual edits if they exist.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.QaAnswer.AnswerValue answer_value = 3;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue $var
     * @return $this
     */
    public function setAnswerValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerValue::class);
        $this->answer_value = $var;

        return $this;
    }

    /**
     * User-defined list of arbitrary tags. Matches the value from
     * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and
     * for weighting the score of each answer.
     *
     * Generated from protobuf field <code>repeated string tags = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * User-defined list of arbitrary tags. Matches the value from
     * QaScorecard.ScorecardQuestion.tags. Used for grouping/organization and
     * for weighting the score of each answer.
     *
     * Generated from protobuf field <code>repeated string tags = 5;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTags($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->tags = $arr;

        return $this;
    }

    /**
     * List of all individual answers given to the question.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAnswerSources()
    {
        return $this->answer_sources;
    }

    /**
     * List of all individual answers given to the question.
     *
     * Generated from protobuf field <code>repeated .google.cloud.contactcenterinsights.v1.QaAnswer.AnswerSource answer_sources = 8;</code>
     * @param array<\Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAnswerSources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ContactCenterInsights\V1\QaAnswer\AnswerSource::class);
        $this->answer_sources = $arr;

        return $this;
    }

}

