<?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 the [long-running operation][google.longrunning.Operation] from
 * the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
 *
 * Generated from protobuf message <code>google.firestore.admin.v1.RestoreDatabaseMetadata</code>
 */
class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The time the restore was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     */
    private $start_time = null;
    /**
     * The time the restore finished, unset for ongoing restores.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     */
    private $end_time = null;
    /**
     * The operation state of the restore.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.OperationState operation_state = 3;</code>
     */
    private $operation_state = 0;
    /**
     * The name of the database being restored to.
     *
     * Generated from protobuf field <code>string database = 4 [(.google.api.resource_reference) = {</code>
     */
    private $database = '';
    /**
     * The name of the backup restoring from.
     *
     * Generated from protobuf field <code>string backup = 5 [(.google.api.resource_reference) = {</code>
     */
    private $backup = '';
    /**
     * How far along the restore is as an estimated percentage of remaining time.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_percentage = 8;</code>
     */
    private $progress_percentage = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The time the restore was started.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The time the restore finished, unset for ongoing restores.
     *     @type int $operation_state
     *           The operation state of the restore.
     *     @type string $database
     *           The name of the database being restored to.
     *     @type string $backup
     *           The name of the backup restoring from.
     *     @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_percentage
     *           How far along the restore is as an estimated percentage of remaining time.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce();
        parent::__construct($data);
    }

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

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

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

    /**
     * The time the restore was 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 the restore finished, unset for ongoing restores.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

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

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

    /**
     * The time the restore finished, unset for ongoing restores.
     *
     * 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 operation state of the restore.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.OperationState operation_state = 3;</code>
     * @return int
     */
    public function getOperationState()
    {
        return $this->operation_state;
    }

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

        return $this;
    }

    /**
     * The name of the database being restored to.
     *
     * Generated from protobuf field <code>string database = 4 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getDatabase()
    {
        return $this->database;
    }

    /**
     * The name of the database being restored to.
     *
     * Generated from protobuf field <code>string database = 4 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setDatabase($var)
    {
        GPBUtil::checkString($var, True);
        $this->database = $var;

        return $this;
    }

    /**
     * The name of the backup restoring from.
     *
     * Generated from protobuf field <code>string backup = 5 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getBackup()
    {
        return $this->backup;
    }

    /**
     * The name of the backup restoring from.
     *
     * Generated from protobuf field <code>string backup = 5 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setBackup($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup = $var;

        return $this;
    }

    /**
     * How far along the restore is as an estimated percentage of remaining time.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_percentage = 8;</code>
     * @return \Google\Cloud\Firestore\Admin\V1\Progress|null
     */
    public function getProgressPercentage()
    {
        return $this->progress_percentage;
    }

    public function hasProgressPercentage()
    {
        return isset($this->progress_percentage);
    }

    public function clearProgressPercentage()
    {
        unset($this->progress_percentage);
    }

    /**
     * How far along the restore is as an estimated percentage of remaining time.
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Progress progress_percentage = 8;</code>
     * @param \Google\Cloud\Firestore\Admin\V1\Progress $var
     * @return $this
     */
    public function setProgressPercentage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class);
        $this->progress_percentage = $var;

        return $this;
    }

}

