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

namespace Couchbase\Protostellar\Generated\Analytics\V1;

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

/**
 * Generated from protobuf message <code>couchbase.analytics.v1.AnalyticsQueryRequest</code>
 */
class AnalyticsQueryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string bucket_name = 8;</code>
     */
    protected $bucket_name = null;
    /**
     * Generated from protobuf field <code>optional string scope_name = 9;</code>
     */
    protected $scope_name = null;
    /**
     * Generated from protobuf field <code>string statement = 1;</code>
     */
    protected $statement = '';
    /**
     * Generated from protobuf field <code>optional bool read_only = 2;</code>
     */
    protected $read_only = null;
    /**
     * Generated from protobuf field <code>optional string client_context_id = 3;</code>
     */
    protected $client_context_id = null;
    /**
     * Generated from protobuf field <code>optional bool priority = 4;</code>
     */
    protected $priority = null;
    /**
     * Generated from protobuf field <code>optional .couchbase.analytics.v1.AnalyticsQueryRequest.ScanConsistency scan_consistency = 5;</code>
     */
    protected $scan_consistency = null;
    /**
     * Generated from protobuf field <code>repeated bytes positional_parameters = 6;</code>
     */
    private $positional_parameters;
    /**
     * Generated from protobuf field <code>map<string, bytes> named_parameters = 7;</code>
     */
    private $named_parameters;

    /**
     * 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 string $client_context_id
     *     @type bool $priority
     *     @type int $scan_consistency
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $positional_parameters
     *     @type array|\Google\Protobuf\Internal\MapField $named_parameters
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Analytics\V1\Analytics::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional string bucket_name = 8;</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 = 8;</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 = 9;</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 = 9;</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 = 1;</code>
     * @return string
     */
    public function getStatement()
    {
        return $this->statement;
    }

    /**
     * Generated from protobuf field <code>string statement = 1;</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 = 2;</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 = 2;</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 string client_context_id = 3;</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 = 3;</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 bool priority = 4;</code>
     * @return bool
     */
    public function getPriority()
    {
        return isset($this->priority) ? $this->priority : false;
    }

    public function hasPriority()
    {
        return isset($this->priority);
    }

    public function clearPriority()
    {
        unset($this->priority);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.analytics.v1.AnalyticsQueryRequest.ScanConsistency scan_consistency = 5;</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.analytics.v1.AnalyticsQueryRequest.ScanConsistency scan_consistency = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setScanConsistency($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Analytics\V1\AnalyticsQueryRequest\ScanConsistency::class);
        $this->scan_consistency = $var;

        return $this;
    }

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

    /**
     * Generated from protobuf field <code>repeated bytes positional_parameters = 6;</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 = 7;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getNamedParameters()
    {
        return $this->named_parameters;
    }

    /**
     * Generated from protobuf field <code>map<string, bytes> named_parameters = 7;</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;
    }

}

