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

namespace Google\Cloud\Datastore\Admin\V1;

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

/**
 * The request for
 * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
 *
 * Generated from protobuf message <code>google.datastore.admin.v1.CreateIndexRequest</code>
 */
class CreateIndexRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Project ID against which to make the request.
     *
     * Generated from protobuf field <code>string project_id = 1;</code>
     */
    private $project_id = '';
    /**
     * The index to create. The name and state fields are output only and will be
     * ignored. Single property indexes cannot be created or deleted.
     *
     * Generated from protobuf field <code>.google.datastore.admin.v1.Index index = 3;</code>
     */
    private $index = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $project_id
     *           Project ID against which to make the request.
     *     @type \Google\Cloud\Datastore\Admin\V1\Index $index
     *           The index to create. The name and state fields are output only and will be
     *           ignored. Single property indexes cannot be created or deleted.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * Project ID against which to make the request.
     *
     * Generated from protobuf field <code>string project_id = 1;</code>
     * @return string
     */
    public function getProjectId()
    {
        return $this->project_id;
    }

    /**
     * Project ID against which to make the request.
     *
     * Generated from protobuf field <code>string project_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setProjectId($var)
    {
        GPBUtil::checkString($var, True);
        $this->project_id = $var;

        return $this;
    }

    /**
     * The index to create. The name and state fields are output only and will be
     * ignored. Single property indexes cannot be created or deleted.
     *
     * Generated from protobuf field <code>.google.datastore.admin.v1.Index index = 3;</code>
     * @return \Google\Cloud\Datastore\Admin\V1\Index|null
     */
    public function getIndex()
    {
        return $this->index;
    }

    public function hasIndex()
    {
        return isset($this->index);
    }

    public function clearIndex()
    {
        unset($this->index);
    }

    /**
     * The index to create. The name and state fields are output only and will be
     * ignored. Single property indexes cannot be created or deleted.
     *
     * Generated from protobuf field <code>.google.datastore.admin.v1.Index index = 3;</code>
     * @param \Google\Cloud\Datastore\Admin\V1\Index $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Index::class);
        $this->index = $var;

        return $this;
    }

}

