<?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 google.longrunning.Operation returned by
 * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
 *
 * Generated from protobuf message <code>google.spanner.admin.database.v1.CopyBackupMetadata</code>
 */
class CopyBackupMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the backup being created through the copy operation.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.resource_reference) = {</code>
     */
    private $name = '';
    /**
     * The name of the source backup that is being copied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * Generated from protobuf field <code>string source_backup = 2 [(.google.api.resource_reference) = {</code>
     */
    private $source_backup = '';
    /**
     * The progress of the
     * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
     *
     * Generated from protobuf field <code>.google.spanner.admin.database.v1.OperationProgress progress = 3;</code>
     */
    private $progress = null;
    /**
     * The time at which cancellation of CopyBackup 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 through the copy operation.
     *           Values are of the form
     *           `projects/<project>/instances/<instance>/backups/<backup>`.
     *     @type string $source_backup
     *           The name of the source backup that is being copied.
     *           Values are of the form
     *           `projects/<project>/instances/<instance>/backups/<backup>`.
     *     @type \Google\Cloud\Spanner\Admin\Database\V1\OperationProgress $progress
     *           The progress of the
     *           [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
     *     @type \Google\Protobuf\Timestamp $cancel_time
     *           The time at which cancellation of CopyBackup 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 through the copy operation.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * 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 through the copy operation.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * 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 source backup that is being copied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * Generated from protobuf field <code>string source_backup = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSourceBackup()
    {
        return $this->source_backup;
    }

    /**
     * The name of the source backup that is being copied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/backups/<backup>`.
     *
     * Generated from protobuf field <code>string source_backup = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSourceBackup($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_backup = $var;

        return $this;
    }

    /**
     * The progress of the
     * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] 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 $this->progress;
    }

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

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

    /**
     * The progress of the
     * [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] 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 CopyBackup 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 $this->cancel_time;
    }

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

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

    /**
     * The time at which cancellation of CopyBackup 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;
    }

}

