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

namespace Couchbase\Protostellar\Generated\Query\V1;

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

/**
 * Generated from protobuf message <code>couchbase.query.v1.QueryRequest</code>
 */
class QueryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string bucket_name = 1;</code>
     */
    protected $bucket_name = null;
    /**
     * Generated from protobuf field <code>optional string scope_name = 2;</code>
     */
    protected $scope_name = null;
    /**
     * Generated from protobuf field <code>string statement = 3;</code>
     */
    protected $statement = '';
    /**
     * Generated from protobuf field <code>optional bool read_only = 4;</code>
     */
    protected $read_only = null;
    /**
     * Generated from protobuf field <code>optional bool prepared = 5;</code>
     */
    protected $prepared = null;
    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.TuningOptions tuning_options = 6;</code>
     */
    protected $tuning_options = null;
    /**
     * Generated from protobuf field <code>optional string client_context_id = 7;</code>
     */
    protected $client_context_id = null;
    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ScanConsistency scan_consistency = 8;</code>
     */
    protected $scan_consistency = null;
    /**
     * Generated from protobuf field <code>repeated bytes positional_parameters = 9;</code>
     */
    private $positional_parameters;
    /**
     * Generated from protobuf field <code>map<string, bytes> named_parameters = 10;</code>
     */
    private $named_parameters;
    /**
     * Generated from protobuf field <code>optional bool flex_index = 11;</code>
     */
    protected $flex_index = null;
    /**
     * Generated from protobuf field <code>optional bool preserve_expiry = 12;</code>
     */
    protected $preserve_expiry = null;
    /**
     * Generated from protobuf field <code>repeated .couchbase.kv.v1.MutationToken consistent_with = 13;</code>
     */
    private $consistent_with;
    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ProfileMode profile_mode = 14;</code>
     */
    protected $profile_mode = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $bucket_name
     *     @type string $scope_name
     *     @type string $statement
     *     @type bool $read_only
     *     @type bool $prepared
     *     @type \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\TuningOptions $tuning_options
     *     @type string $client_context_id
     *     @type int $scan_consistency
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $positional_parameters
     *     @type array|\Google\Protobuf\Internal\MapField $named_parameters
     *     @type bool $flex_index
     *     @type bool $preserve_expiry
     *     @type array<\Couchbase\Protostellar\Generated\KV\V1\MutationToken>|\Google\Protobuf\Internal\RepeatedField $consistent_with
     *     @type int $profile_mode
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Query\V1\Query::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional string bucket_name = 1;</code>
     * @return string
     */
    public function getBucketName()
    {
        return isset($this->bucket_name) ? $this->bucket_name : '';
    }

    public function hasBucketName()
    {
        return isset($this->bucket_name);
    }

    public function clearBucketName()
    {
        unset($this->bucket_name);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string scope_name = 2;</code>
     * @return string
     */
    public function getScopeName()
    {
        return isset($this->scope_name) ? $this->scope_name : '';
    }

    public function hasScopeName()
    {
        return isset($this->scope_name);
    }

    public function clearScopeName()
    {
        unset($this->scope_name);
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool read_only = 4;</code>
     * @return bool
     */
    public function getReadOnly()
    {
        return isset($this->read_only) ? $this->read_only : false;
    }

    public function hasReadOnly()
    {
        return isset($this->read_only);
    }

    public function clearReadOnly()
    {
        unset($this->read_only);
    }

    /**
     * Generated from protobuf field <code>optional bool read_only = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setReadOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->read_only = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool prepared = 5;</code>
     * @return bool
     */
    public function getPrepared()
    {
        return isset($this->prepared) ? $this->prepared : false;
    }

    public function hasPrepared()
    {
        return isset($this->prepared);
    }

    public function clearPrepared()
    {
        unset($this->prepared);
    }

    /**
     * Generated from protobuf field <code>optional bool prepared = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setPrepared($var)
    {
        GPBUtil::checkBool($var);
        $this->prepared = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.TuningOptions tuning_options = 6;</code>
     * @return \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\TuningOptions|null
     */
    public function getTuningOptions()
    {
        return $this->tuning_options;
    }

    public function hasTuningOptions()
    {
        return isset($this->tuning_options);
    }

    public function clearTuningOptions()
    {
        unset($this->tuning_options);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.TuningOptions tuning_options = 6;</code>
     * @param \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\TuningOptions $var
     * @return $this
     */
    public function setTuningOptions($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\TuningOptions::class);
        $this->tuning_options = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string client_context_id = 7;</code>
     * @return string
     */
    public function getClientContextId()
    {
        return isset($this->client_context_id) ? $this->client_context_id : '';
    }

    public function hasClientContextId()
    {
        return isset($this->client_context_id);
    }

    public function clearClientContextId()
    {
        unset($this->client_context_id);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ScanConsistency scan_consistency = 8;</code>
     * @return int
     */
    public function getScanConsistency()
    {
        return isset($this->scan_consistency) ? $this->scan_consistency : 0;
    }

    public function hasScanConsistency()
    {
        return isset($this->scan_consistency);
    }

    public function clearScanConsistency()
    {
        unset($this->scan_consistency);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ScanConsistency scan_consistency = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setScanConsistency($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\ScanConsistency::class);
        $this->scan_consistency = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated bytes positional_parameters = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPositionalParameters()
    {
        return $this->positional_parameters;
    }

    /**
     * Generated from protobuf field <code>repeated bytes positional_parameters = 9;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPositionalParameters($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES);
        $this->positional_parameters = $arr;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool flex_index = 11;</code>
     * @return bool
     */
    public function getFlexIndex()
    {
        return isset($this->flex_index) ? $this->flex_index : false;
    }

    public function hasFlexIndex()
    {
        return isset($this->flex_index);
    }

    public function clearFlexIndex()
    {
        unset($this->flex_index);
    }

    /**
     * Generated from protobuf field <code>optional bool flex_index = 11;</code>
     * @param bool $var
     * @return $this
     */
    public function setFlexIndex($var)
    {
        GPBUtil::checkBool($var);
        $this->flex_index = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool preserve_expiry = 12;</code>
     * @return bool
     */
    public function getPreserveExpiry()
    {
        return isset($this->preserve_expiry) ? $this->preserve_expiry : false;
    }

    public function hasPreserveExpiry()
    {
        return isset($this->preserve_expiry);
    }

    public function clearPreserveExpiry()
    {
        unset($this->preserve_expiry);
    }

    /**
     * Generated from protobuf field <code>optional bool preserve_expiry = 12;</code>
     * @param bool $var
     * @return $this
     */
    public function setPreserveExpiry($var)
    {
        GPBUtil::checkBool($var);
        $this->preserve_expiry = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .couchbase.kv.v1.MutationToken consistent_with = 13;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConsistentWith()
    {
        return $this->consistent_with;
    }

    /**
     * Generated from protobuf field <code>repeated .couchbase.kv.v1.MutationToken consistent_with = 13;</code>
     * @param array<\Couchbase\Protostellar\Generated\KV\V1\MutationToken>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConsistentWith($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Couchbase\Protostellar\Generated\KV\V1\MutationToken::class);
        $this->consistent_with = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ProfileMode profile_mode = 14;</code>
     * @return int
     */
    public function getProfileMode()
    {
        return isset($this->profile_mode) ? $this->profile_mode : 0;
    }

    public function hasProfileMode()
    {
        return isset($this->profile_mode);
    }

    public function clearProfileMode()
    {
        unset($this->profile_mode);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.query.v1.QueryRequest.ProfileMode profile_mode = 14;</code>
     * @param int $var
     * @return $this
     */
    public function setProfileMode($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Query\V1\QueryRequest\ProfileMode::class);
        $this->profile_mode = $var;

        return $this;
    }

}

