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

namespace Google\Cloud\Spanner\Admin\Database\V1;

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

/**
 * Metadata type for the operation returned by
 * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
 *
 * Generated from protobuf message <code>google.spanner.admin.database.v1.CreateBackupMetadata</code>
 */
class CreateBackupMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the backup being created.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.resource_reference) = {</code>
     */
    private $name = '';
    /**
     * The name of the database the backup is created from.
     *
     * Generated from protobuf field <code>string database = 2 [(.google.api.resource_reference) = {</code>
     */
    private $database = '';
    /**
     * The progress of the
     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
     *
     * Generated from protobuf field <code>.google.spanner.admin.database.v1.OperationProgress progress = 3;</code>
     */
    private $progress = null;
    /**
     * The time at which cancellation of this operation was received.
     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
     * starts asynchronous cancellation on a long-running operation. The server
     * makes a best effort to cancel the operation, but success is not guaranteed.
     * Clients can use
     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
     * other methods to check whether the cancellation succeeded or whether the
     * operation completed despite cancellation. On successful cancellation,
     * the operation is not deleted; instead, it becomes an operation with
     * an [Operation.error][google.longrunning.Operation.error] value with a
     * [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cancel_time = 4;</code>
     */
    private $cancel_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the backup being created.
     *     @type string $database
     *           The name of the database the backup is created from.
     *     @type \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $progress
     *           The progress of the
     *           [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
     *     @type \Google\Protobuf\Timestamp $cancel_time
     *           The time at which cancellation of this operation was received.
     *           [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
     *           starts asynchronous cancellation on a long-running operation. The server
     *           makes a best effort to cancel the operation, but success is not guaranteed.
     *           Clients can use
     *           [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
     *           other methods to check whether the cancellation succeeded or whether the
     *           operation completed despite cancellation. On successful cancellation,
     *           the operation is not deleted; instead, it becomes an operation with
     *           an [Operation.error][google.longrunning.Operation.error] value with a
     *           [google.rpc.Status.code][google.rpc.Status.code] of 1,
     *           corresponding to `Code.CANCELLED`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\Admin\Database\V1\Backup::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * The progress of the
     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
     *
     * Generated from protobuf field <code>.google.spanner.admin.database.v1.OperationProgress progress = 3;</code>
     * @return \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress|null
     */
    public function getProgress()
    {
        return isset($this->progress) ? $this->progress : null;
    }

    public function hasProgress()
    {
        return isset($this->progress);
    }

    public function clearProgress()
    {
        unset($this->progress);
    }

    /**
     * The progress of the
     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
     *
     * Generated from protobuf field <code>.google.spanner.admin.database.v1.OperationProgress progress = 3;</code>
     * @param \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $var
     * @return $this
     */
    public function setProgress($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress::class);
        $this->progress = $var;

        return $this;
    }

    /**
     * The time at which cancellation of this operation was received.
     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
     * starts asynchronous cancellation on a long-running operation. The server
     * makes a best effort to cancel the operation, but success is not guaranteed.
     * Clients can use
     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
     * other methods to check whether the cancellation succeeded or whether the
     * operation completed despite cancellation. On successful cancellation,
     * the operation is not deleted; instead, it becomes an operation with
     * an [Operation.error][google.longrunning.Operation.error] value with a
     * [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cancel_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCancelTime()
    {
        return isset($this->cancel_time) ? $this->cancel_time : null;
    }

    public function hasCancelTime()
    {
        return isset($this->cancel_time);
    }

    public function clearCancelTime()
    {
        unset($this->cancel_time);
    }

    /**
     * The time at which cancellation of this operation was received.
     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
     * starts asynchronous cancellation on a long-running operation. The server
     * makes a best effort to cancel the operation, but success is not guaranteed.
     * Clients can use
     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
     * other methods to check whether the cancellation succeeded or whether the
     * operation completed despite cancellation. On successful cancellation,
     * the operation is not deleted; instead, it becomes an operation with
     * an [Operation.error][google.longrunning.Operation.error] value with a
     * [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cancel_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCancelTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->cancel_time = $var;

        return $this;
    }

}

