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

namespace Google\Cloud\Firestore\V1;

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

/**
 * A Firestore query represented as an ordered list of operations / stages.
 * This is considered the top-level function which plans and executes a query.
 * It is logically equivalent to `query(stages, options)`, but prevents the
 * client from having to build a function wrapper.
 *
 * Generated from protobuf message <code>google.firestore.v1.StructuredPipeline</code>
 */
class StructuredPipeline extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The pipeline query to execute.
     *
     * Generated from protobuf field <code>.google.firestore.v1.Pipeline pipeline = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $pipeline = null;
    /**
     * Optional. Optional query-level arguments.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $options;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Firestore\V1\Pipeline $pipeline
     *           Required. The pipeline query to execute.
     *     @type array|\Google\Protobuf\Internal\MapField $options
     *           Optional. Optional query-level arguments.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\Pipeline::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The pipeline query to execute.
     *
     * Generated from protobuf field <code>.google.firestore.v1.Pipeline pipeline = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Firestore\V1\Pipeline|null
     */
    public function getPipeline()
    {
        return $this->pipeline;
    }

    public function hasPipeline()
    {
        return isset($this->pipeline);
    }

    public function clearPipeline()
    {
        unset($this->pipeline);
    }

    /**
     * Required. The pipeline query to execute.
     *
     * Generated from protobuf field <code>.google.firestore.v1.Pipeline pipeline = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Firestore\V1\Pipeline $var
     * @return $this
     */
    public function setPipeline($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Pipeline::class);
        $this->pipeline = $var;

        return $this;
    }

    /**
     * Optional. Optional query-level arguments.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * Optional. Optional query-level arguments.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setOptions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class);
        $this->options = $arr;

        return $this;
    }

}

