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

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

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

/**
 * Generated from protobuf message <code>couchbase.admin.query.v1.GetAllIndexesResponse.Index</code>
 */
class Index extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string bucket_name = 1;</code>
     */
    protected $bucket_name = '';
    /**
     * Generated from protobuf field <code>string scope_name = 2;</code>
     */
    protected $scope_name = '';
    /**
     * Generated from protobuf field <code>string collection_name = 3;</code>
     */
    protected $collection_name = '';
    /**
     * Generated from protobuf field <code>string name = 4;</code>
     */
    protected $name = '';
    /**
     * Generated from protobuf field <code>bool is_primary = 5;</code>
     */
    protected $is_primary = false;
    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexType type = 6;</code>
     */
    protected $type = 0;
    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexState state = 7;</code>
     */
    protected $state = 0;
    /**
     * Generated from protobuf field <code>repeated string fields = 8;</code>
     */
    private $fields;
    /**
     * Generated from protobuf field <code>optional string condition = 9;</code>
     */
    protected $condition = null;
    /**
     * Generated from protobuf field <code>optional string partition = 10;</code>
     */
    protected $partition = 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 bool $is_primary
     *     @type int $type
     *     @type int $state
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $fields
     *     @type string $condition
     *     @type string $partition
     * }
     */
    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>string scope_name = 2;</code>
     * @return string
     */
    public function getScopeName()
    {
        return $this->scope_name;
    }

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

    /**
     * Generated from protobuf field <code>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>string name = 4;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>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>bool is_primary = 5;</code>
     * @return bool
     */
    public function getIsPrimary()
    {
        return $this->is_primary;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexType type = 6;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexType type = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Admin\Query\V1\IndexType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexState state = 7;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Generated from protobuf field <code>.couchbase.admin.query.v1.IndexState state = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Admin\Query\V1\IndexState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated string fields = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFields()
    {
        return $this->fields;
    }

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

        return $this;
    }

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

    public function hasCondition()
    {
        return isset($this->condition);
    }

    public function clearCondition()
    {
        unset($this->condition);
    }

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

        return $this;
    }

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

    public function hasPartition()
    {
        return isset($this->partition);
    }

    public function clearPartition()
    {
        unset($this->partition);
    }

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

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Index::class, \Couchbase\Protostellar\Generated\Admin\Query\V1\GetAllIndexesResponse_Index::class);

