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

namespace Google\Cloud\Firestore\Admin\V1;

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

/**
 * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
 * [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
 *
 * Generated from protobuf message <code>google.firestore.admin.v1.IndexOperationMetadata</code>
 */
class IndexOperationMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The time this operation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     */
    private $start_time = null;
    /**
     * The time this operation completed. Will be unset if operation still in
     * progress.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     */
    private $end_time = null;
    /**
     * The index resource that this operation is acting on. For example:
     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
     *
     * Generated from protobuf field <code>string index = 3;</code>
     */
    private $index = '';
    /**
     * The state of the operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.OperationState state = 4;</code>
     */
    private $state = 0;
    /**
     * The progress, in documents, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_documents = 5;</code>
     */
    private $progress_documents = null;
    /**
     * The progress, in bytes, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_bytes = 6;</code>
     */
    private $progress_bytes = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The time this operation started.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The time this operation completed. Will be unset if operation still in
     *           progress.
     *     @type string $index
     *           The index resource that this operation is acting on. For example:
     *           `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
     *     @type int $state
     *           The state of the operation.
     *     @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents
     *           The progress, in documents, of this operation.
     *     @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes
     *           The progress, in bytes, of this operation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce();
        parent::__construct($data);
    }

    /**
     * The time this operation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getStartTime()
    {
        return isset($this->start_time) ? $this->start_time : null;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * The time this operation started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * The time this operation completed. Will be unset if operation still in
     * progress.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getEndTime()
    {
        return isset($this->end_time) ? $this->end_time : null;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * The time this operation completed. Will be unset if operation still in
     * progress.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * The index resource that this operation is acting on. For example:
     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
     *
     * Generated from protobuf field <code>string index = 3;</code>
     * @return string
     */
    public function getIndex()
    {
        return $this->index;
    }

    /**
     * The index resource that this operation is acting on. For example:
     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
     *
     * Generated from protobuf field <code>string index = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkString($var, True);
        $this->index = $var;

        return $this;
    }

    /**
     * The state of the operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.OperationState state = 4;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.OperationState state = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The progress, in documents, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_documents = 5;</code>
     * @return \Google\Cloud\Firestore\Admin\V1\Progress
     */
    public function getProgressDocuments()
    {
        return isset($this->progress_documents) ? $this->progress_documents : null;
    }

    public function hasProgressDocuments()
    {
        return isset($this->progress_documents);
    }

    public function clearProgressDocuments()
    {
        unset($this->progress_documents);
    }

    /**
     * The progress, in documents, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_documents = 5;</code>
     * @param \Google\Cloud\Firestore\Admin\V1\Progress $var
     * @return $this
     */
    public function setProgressDocuments($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class);
        $this->progress_documents = $var;

        return $this;
    }

    /**
     * The progress, in bytes, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_bytes = 6;</code>
     * @return \Google\Cloud\Firestore\Admin\V1\Progress
     */
    public function getProgressBytes()
    {
        return isset($this->progress_bytes) ? $this->progress_bytes : null;
    }

    public function hasProgressBytes()
    {
        return isset($this->progress_bytes);
    }

    public function clearProgressBytes()
    {
        unset($this->progress_bytes);
    }

    /**
     * The progress, in bytes, of this operation.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_bytes = 6;</code>
     * @param \Google\Cloud\Firestore\Admin\V1\Progress $var
     * @return $this
     */
    public function setProgressBytes($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class);
        $this->progress_bytes = $var;

        return $this;
    }

}

