<?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.MetaData</code>
 */
class MetaData extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.SearchMetrics metrics = 1;</code>
     */
    protected $metrics = null;
    /**
     * Generated from protobuf field <code>map<string, string> errors = 2;</code>
     */
    private $errors;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\SearchMetrics $metrics
     *     @type array|\Google\Protobuf\Internal\MapField $errors
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Search\V1\Search::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.SearchMetrics metrics = 1;</code>
     * @return \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\SearchMetrics|null
     */
    public function getMetrics()
    {
        return $this->metrics;
    }

    public function hasMetrics()
    {
        return isset($this->metrics);
    }

    public function clearMetrics()
    {
        unset($this->metrics);
    }

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.SearchMetrics metrics = 1;</code>
     * @param \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\SearchMetrics $var
     * @return $this
     */
    public function setMetrics($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\SearchMetrics::class);
        $this->metrics = $var;

        return $this;
    }

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

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

        return $this;
    }

}

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

