<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: couchbase/search/v1/search.proto

namespace Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse;

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

/**
 * Generated from protobuf message <code>couchbase.search.v1.SearchQueryResponse.SearchQueryRow</code>
 */
class SearchQueryRow extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * Generated from protobuf field <code>double score = 2;</code>
     */
    protected $score = 0.0;
    /**
     * Generated from protobuf field <code>string index = 3;</code>
     */
    protected $index = '';
    /**
     * Generated from protobuf field <code>bytes explanation = 4;</code>
     */
    protected $explanation = '';
    /**
     * Generated from protobuf field <code>repeated .couchbase.search.v1.SearchQueryResponse.Location locations = 5;</code>
     */
    private $locations;
    /**
     * Generated from protobuf field <code>map<string, .couchbase.search.v1.SearchQueryResponse.Fragment> fragments = 6;</code>
     */
    private $fragments;
    /**
     * Generated from protobuf field <code>map<string, bytes> fields = 7;</code>
     */
    private $fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *     @type float $score
     *     @type string $index
     *     @type string $explanation
     *     @type array<\Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\Location>|\Google\Protobuf\Internal\RepeatedField $locations
     *     @type array|\Google\Protobuf\Internal\MapField $fragments
     *     @type array|\Google\Protobuf\Internal\MapField $fields
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Search\V1\Search::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>double score = 2;</code>
     * @return float
     */
    public function getScore()
    {
        return $this->score;
    }

    /**
     * Generated from protobuf field <code>double score = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkDouble($var);
        $this->score = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string index = 3;</code>
     * @return string
     */
    public function getIndex()
    {
        return $this->index;
    }

    /**
     * Generated from protobuf field <code>string index = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkString($var, True);
        $this->index = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes explanation = 4;</code>
     * @return string
     */
    public function getExplanation()
    {
        return $this->explanation;
    }

    /**
     * Generated from protobuf field <code>bytes explanation = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setExplanation($var)
    {
        GPBUtil::checkString($var, False);
        $this->explanation = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .couchbase.search.v1.SearchQueryResponse.Location locations = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLocations()
    {
        return $this->locations;
    }

    /**
     * Generated from protobuf field <code>repeated .couchbase.search.v1.SearchQueryResponse.Location locations = 5;</code>
     * @param array<\Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\Location>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLocations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\Location::class);
        $this->locations = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>map<string, .couchbase.search.v1.SearchQueryResponse.Fragment> fragments = 6;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getFragments()
    {
        return $this->fragments;
    }

    /**
     * Generated from protobuf field <code>map<string, .couchbase.search.v1.SearchQueryResponse.Fragment> fragments = 6;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setFragments($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\Fragment::class);
        $this->fragments = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>map<string, bytes> fields = 7;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * Generated from protobuf field <code>map<string, bytes> fields = 7;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES);
        $this->fields = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SearchQueryRow::class, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse_SearchQueryRow::class);

