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

namespace Couchbase\Protostellar\Generated\Admin\Query\V1;

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

/**
 * Generated from protobuf message <code>couchbase.admin.query.v1.CreatePrimaryIndexRequest</code>
 */
class CreatePrimaryIndexRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string bucket_name = 1;</code>
     */
    protected $bucket_name = '';
    /**
     * Generated from protobuf field <code>optional string scope_name = 2;</code>
     */
    protected $scope_name = null;
    /**
     * Generated from protobuf field <code>optional string collection_name = 3;</code>
     */
    protected $collection_name = null;
    /**
     * Generated from protobuf field <code>optional string name = 4;</code>
     */
    protected $name = null;
    /**
     * Generated from protobuf field <code>optional int32 num_replicas = 5;</code>
     */
    protected $num_replicas = null;
    /**
     * Generated from protobuf field <code>optional bool deferred = 6;</code>
     */
    protected $deferred = null;
    /**
     * Generated from protobuf field <code>optional bool ignore_if_exists = 7;</code>
     */
    protected $ignore_if_exists = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $bucket_name
     *     @type string $scope_name
     *     @type string $collection_name
     *     @type string $name
     *     @type int $num_replicas
     *     @type bool $deferred
     *     @type bool $ignore_if_exists
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Admin\Query\V1\Query::initOnce();
        parent::__construct($data);
    }

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

    /**
     * Generated from protobuf field <code>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>optional string collection_name = 3;</code>
     * @return string
     */
    public function getCollectionName()
    {
        return isset($this->collection_name) ? $this->collection_name : '';
    }

    public function hasCollectionName()
    {
        return isset($this->collection_name);
    }

    public function clearCollectionName()
    {
        unset($this->collection_name);
    }

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

        return $this;
    }

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

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int32 num_replicas = 5;</code>
     * @return int
     */
    public function getNumReplicas()
    {
        return isset($this->num_replicas) ? $this->num_replicas : 0;
    }

    public function hasNumReplicas()
    {
        return isset($this->num_replicas);
    }

    public function clearNumReplicas()
    {
        unset($this->num_replicas);
    }

    /**
     * Generated from protobuf field <code>optional int32 num_replicas = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setNumReplicas($var)
    {
        GPBUtil::checkInt32($var);
        $this->num_replicas = $var;

        return $this;
    }

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

    public function hasDeferred()
    {
        return isset($this->deferred);
    }

    public function clearDeferred()
    {
        unset($this->deferred);
    }

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

        return $this;
    }

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

    public function hasIgnoreIfExists()
    {
        return isset($this->ignore_if_exists);
    }

    public function clearIgnoreIfExists()
    {
        unset($this->ignore_if_exists);
    }

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

        return $this;
    }

}

