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

namespace Google\Cloud\Firestore\V1;

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

/**
 * Explain metrics for the query.
 *
 * Generated from protobuf message <code>google.firestore.v1.ExplainMetrics</code>
 */
class ExplainMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * Planning phase information for the query.
     *
     * Generated from protobuf field <code>.google.firestore.v1.PlanSummary plan_summary = 1;</code>
     */
    private $plan_summary = null;
    /**
     * Aggregated stats from the execution of the query. Only present when
     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
     * to true.
     *
     * Generated from protobuf field <code>.google.firestore.v1.ExecutionStats execution_stats = 2;</code>
     */
    private $execution_stats = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Firestore\V1\PlanSummary $plan_summary
     *           Planning phase information for the query.
     *     @type \Google\Cloud\Firestore\V1\ExecutionStats $execution_stats
     *           Aggregated stats from the execution of the query. Only present when
     *           [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
     *           to true.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce();
        parent::__construct($data);
    }

    /**
     * Planning phase information for the query.
     *
     * Generated from protobuf field <code>.google.firestore.v1.PlanSummary plan_summary = 1;</code>
     * @return \Google\Cloud\Firestore\V1\PlanSummary|null
     */
    public function getPlanSummary()
    {
        return $this->plan_summary;
    }

    public function hasPlanSummary()
    {
        return isset($this->plan_summary);
    }

    public function clearPlanSummary()
    {
        unset($this->plan_summary);
    }

    /**
     * Planning phase information for the query.
     *
     * Generated from protobuf field <code>.google.firestore.v1.PlanSummary plan_summary = 1;</code>
     * @param \Google\Cloud\Firestore\V1\PlanSummary $var
     * @return $this
     */
    public function setPlanSummary($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\PlanSummary::class);
        $this->plan_summary = $var;

        return $this;
    }

    /**
     * Aggregated stats from the execution of the query. Only present when
     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
     * to true.
     *
     * Generated from protobuf field <code>.google.firestore.v1.ExecutionStats execution_stats = 2;</code>
     * @return \Google\Cloud\Firestore\V1\ExecutionStats|null
     */
    public function getExecutionStats()
    {
        return $this->execution_stats;
    }

    public function hasExecutionStats()
    {
        return isset($this->execution_stats);
    }

    public function clearExecutionStats()
    {
        unset($this->execution_stats);
    }

    /**
     * Aggregated stats from the execution of the query. Only present when
     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
     * to true.
     *
     * Generated from protobuf field <code>.google.firestore.v1.ExecutionStats execution_stats = 2;</code>
     * @param \Google\Cloud\Firestore\V1\ExecutionStats $var
     * @return $this
     */
    public function setExecutionStats($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExecutionStats::class);
        $this->execution_stats = $var;

        return $this;
    }

}

