<?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.SearchMetrics</code>
 */
class SearchMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.google.protobuf.Duration execution_time = 1;</code>
     */
    protected $execution_time = null;
    /**
     * Generated from protobuf field <code>uint64 total_rows = 2;</code>
     */
    protected $total_rows = 0;
    /**
     * Generated from protobuf field <code>double max_score = 3;</code>
     */
    protected $max_score = 0.0;
    /**
     * Generated from protobuf field <code>uint64 total_partition_count = 4;</code>
     */
    protected $total_partition_count = 0;
    /**
     * Generated from protobuf field <code>uint64 success_partition_count = 5;</code>
     */
    protected $success_partition_count = 0;
    /**
     * Generated from protobuf field <code>uint64 error_partition_count = 6;</code>
     */
    protected $error_partition_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $execution_time
     *     @type int|string $total_rows
     *     @type float $max_score
     *     @type int|string $total_partition_count
     *     @type int|string $success_partition_count
     *     @type int|string $error_partition_count
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Search\V1\Search::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration execution_time = 1;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getExecutionTime()
    {
        return $this->execution_time;
    }

    public function hasExecutionTime()
    {
        return isset($this->execution_time);
    }

    public function clearExecutionTime()
    {
        unset($this->execution_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration execution_time = 1;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setExecutionTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->execution_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint64 total_rows = 2;</code>
     * @return int|string
     */
    public function getTotalRows()
    {
        return $this->total_rows;
    }

    /**
     * Generated from protobuf field <code>uint64 total_rows = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTotalRows($var)
    {
        GPBUtil::checkUint64($var);
        $this->total_rows = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint64 total_partition_count = 4;</code>
     * @return int|string
     */
    public function getTotalPartitionCount()
    {
        return $this->total_partition_count;
    }

    /**
     * Generated from protobuf field <code>uint64 total_partition_count = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTotalPartitionCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->total_partition_count = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint64 success_partition_count = 5;</code>
     * @return int|string
     */
    public function getSuccessPartitionCount()
    {
        return $this->success_partition_count;
    }

    /**
     * Generated from protobuf field <code>uint64 success_partition_count = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSuccessPartitionCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->success_partition_count = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint64 error_partition_count = 6;</code>
     * @return int|string
     */
    public function getErrorPartitionCount()
    {
        return $this->error_partition_count;
    }

    /**
     * Generated from protobuf field <code>uint64 error_partition_count = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setErrorPartitionCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->error_partition_count = $var;

        return $this;
    }

}

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

