<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/discoveryengine/v1beta/conversation.proto

namespace Google\Cloud\DiscoveryEngine\V1beta;

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

/**
 * Defines a reply message to user.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.Reply</code>
 */
class Reply extends \Google\Protobuf\Internal\Message
{
    /**
     * DEPRECATED: use `summary` instead.
     * Text reply.
     *
     * Generated from protobuf field <code>string reply = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $reply = '';
    /**
     * References in the reply.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true];</code>
     * @deprecated
     */
    private $references;
    /**
     * Summary based on search results.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3;</code>
     */
    protected $summary = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $reply
     *           DEPRECATED: use `summary` instead.
     *           Text reply.
     *     @type array<\Google\Cloud\DiscoveryEngine\V1beta\Reply\Reference>|\Google\Protobuf\Internal\RepeatedField $references
     *           References in the reply.
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary $summary
     *           Summary based on search results.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\Conversation::initOnce();
        parent::__construct($data);
    }

    /**
     * DEPRECATED: use `summary` instead.
     * Text reply.
     *
     * Generated from protobuf field <code>string reply = 1 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getReply()
    {
        @trigger_error('reply is deprecated.', E_USER_DEPRECATED);
        return $this->reply;
    }

    /**
     * DEPRECATED: use `summary` instead.
     * Text reply.
     *
     * Generated from protobuf field <code>string reply = 1 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setReply($var)
    {
        @trigger_error('reply is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->reply = $var;

        return $this;
    }

    /**
     * References in the reply.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     * @deprecated
     */
    public function getReferences()
    {
        @trigger_error('references is deprecated.', E_USER_DEPRECATED);
        return $this->references;
    }

    /**
     * References in the reply.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true];</code>
     * @param array<\Google\Cloud\DiscoveryEngine\V1beta\Reply\Reference>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     * @deprecated
     */
    public function setReferences($var)
    {
        @trigger_error('references is deprecated.', E_USER_DEPRECATED);
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\Reply\Reference::class);
        $this->references = $arr;

        return $this;
    }

    /**
     * Summary based on search results.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3;</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary|null
     */
    public function getSummary()
    {
        return $this->summary;
    }

    public function hasSummary()
    {
        return isset($this->summary);
    }

    public function clearSummary()
    {
        unset($this->summary);
    }

    /**
     * Summary based on search results.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3;</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary $var
     * @return $this
     */
    public function setSummary($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary::class);
        $this->summary = $var;

        return $this;
    }

}

