<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/gkebackup/v1/volume.proto

namespace Google\Cloud\GkeBackup\V1;

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

/**
 * Represents the backup of a specific persistent volume as a component of a
 * Backup - both the record of the operation and a pointer to the underlying
 * storage-specific artifacts.
 * Next id: 14
 *
 * Generated from protobuf message <code>google.cloud.gkebackup.v1.VolumeBackup</code>
 */
class VolumeBackup extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The full name of the VolumeBackup resource.
     * Format: projects/&#42;&#47;locations/&#42;&#47;backupPlans/&#42;&#47;backups/&#42;&#47;volumeBackups/&#42;.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. Server generated global unique identifier of
     * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
     *
     * Generated from protobuf field <code>string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $uid = '';
    /**
     * Output only. The timestamp when this VolumeBackup resource was
     * created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The timestamp when this VolumeBackup resource was last
     * updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * Output only. A reference to the source Kubernetes PVC from which this VolumeBackup
     * was created.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.NamespacedName source_pvc = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $source_pvc = null;
    /**
     * Output only. A storage system-specific opaque handle to the underlying volume backup.
     *
     * Generated from protobuf field <code>string volume_backup_handle = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $volume_backup_handle = '';
    /**
     * Output only. The format used for the volume backup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat format = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $format = 0;
    /**
     * Output only. The aggregate size of the underlying artifacts associated with this
     * VolumeBackup in the backup storage. This may change over time when
     * multiple backups of the same volume share the same backup storage
     * location. In particular, this is likely to increase in size when
     * the immediately preceding backup of the same volume is deleted.
     *
     * Generated from protobuf field <code>int64 storage_bytes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $storage_bytes = 0;
    /**
     * Output only. The minimum size of the disk to which this VolumeBackup can be restored.
     *
     * Generated from protobuf field <code>int64 disk_size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $disk_size_bytes = 0;
    /**
     * Output only. The timestamp when the associated underlying volume backup
     * operation completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp complete_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $complete_time = null;
    /**
     * Output only. The current state of this VolumeBackup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. A human readable message explaining why the VolumeBackup is in its current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state_message = '';
    /**
     * Output only. `etag` is used for optimistic concurrency control as a way to help
     * prevent simultaneous updates of a volume backup from overwriting each
     * other. It is strongly suggested that systems make use of the `etag` in the
     * read-modify-write cycle to perform volume backup updates in order to avoid
     * race conditions.
     *
     * Generated from protobuf field <code>string etag = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $etag = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The full name of the VolumeBackup resource.
     *           Format: projects/&#42;&#47;locations/&#42;&#47;backupPlans/&#42;&#47;backups/&#42;&#47;volumeBackups/&#42;.
     *     @type string $uid
     *           Output only. Server generated global unique identifier of
     *           [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp when this VolumeBackup resource was
     *           created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The timestamp when this VolumeBackup resource was last
     *           updated.
     *     @type \Google\Cloud\GkeBackup\V1\NamespacedName $source_pvc
     *           Output only. A reference to the source Kubernetes PVC from which this VolumeBackup
     *           was created.
     *     @type string $volume_backup_handle
     *           Output only. A storage system-specific opaque handle to the underlying volume backup.
     *     @type int $format
     *           Output only. The format used for the volume backup.
     *     @type int|string $storage_bytes
     *           Output only. The aggregate size of the underlying artifacts associated with this
     *           VolumeBackup in the backup storage. This may change over time when
     *           multiple backups of the same volume share the same backup storage
     *           location. In particular, this is likely to increase in size when
     *           the immediately preceding backup of the same volume is deleted.
     *     @type int|string $disk_size_bytes
     *           Output only. The minimum size of the disk to which this VolumeBackup can be restored.
     *     @type \Google\Protobuf\Timestamp $complete_time
     *           Output only. The timestamp when the associated underlying volume backup
     *           operation completed.
     *     @type int $state
     *           Output only. The current state of this VolumeBackup.
     *     @type string $state_message
     *           Output only. A human readable message explaining why the VolumeBackup is in its current
     *           state.
     *     @type string $etag
     *           Output only. `etag` is used for optimistic concurrency control as a way to help
     *           prevent simultaneous updates of a volume backup from overwriting each
     *           other. It is strongly suggested that systems make use of the `etag` in the
     *           read-modify-write cycle to perform volume backup updates in order to avoid
     *           race conditions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkebackup\V1\Volume::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The full name of the VolumeBackup resource.
     * Format: projects/&#42;&#47;locations/&#42;&#47;backupPlans/&#42;&#47;backups/&#42;&#47;volumeBackups/&#42;.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The full name of the VolumeBackup resource.
     * Format: projects/&#42;&#47;locations/&#42;&#47;backupPlans/&#42;&#47;backups/&#42;&#47;volumeBackups/&#42;.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. Server generated global unique identifier of
     * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
     *
     * Generated from protobuf field <code>string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getUid()
    {
        return $this->uid;
    }

    /**
     * Output only. Server generated global unique identifier of
     * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
     *
     * Generated from protobuf field <code>string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setUid($var)
    {
        GPBUtil::checkString($var, True);
        $this->uid = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when this VolumeBackup resource was
     * created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The timestamp when this VolumeBackup resource was
     * created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when this VolumeBackup resource was last
     * updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The timestamp when this VolumeBackup resource was last
     * updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. A reference to the source Kubernetes PVC from which this VolumeBackup
     * was created.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.NamespacedName source_pvc = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\GkeBackup\V1\NamespacedName|null
     */
    public function getSourcePvc()
    {
        return $this->source_pvc;
    }

    public function hasSourcePvc()
    {
        return isset($this->source_pvc);
    }

    public function clearSourcePvc()
    {
        unset($this->source_pvc);
    }

    /**
     * Output only. A reference to the source Kubernetes PVC from which this VolumeBackup
     * was created.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.NamespacedName source_pvc = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\GkeBackup\V1\NamespacedName $var
     * @return $this
     */
    public function setSourcePvc($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\NamespacedName::class);
        $this->source_pvc = $var;

        return $this;
    }

    /**
     * Output only. A storage system-specific opaque handle to the underlying volume backup.
     *
     * Generated from protobuf field <code>string volume_backup_handle = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getVolumeBackupHandle()
    {
        return $this->volume_backup_handle;
    }

    /**
     * Output only. A storage system-specific opaque handle to the underlying volume backup.
     *
     * Generated from protobuf field <code>string volume_backup_handle = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setVolumeBackupHandle($var)
    {
        GPBUtil::checkString($var, True);
        $this->volume_backup_handle = $var;

        return $this;
    }

    /**
     * Output only. The format used for the volume backup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat format = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getFormat()
    {
        return $this->format;
    }

    /**
     * Output only. The format used for the volume backup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat format = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\GkeBackup\V1\VolumeBackup\VolumeBackupFormat::class);
        $this->format = $var;

        return $this;
    }

    /**
     * Output only. The aggregate size of the underlying artifacts associated with this
     * VolumeBackup in the backup storage. This may change over time when
     * multiple backups of the same volume share the same backup storage
     * location. In particular, this is likely to increase in size when
     * the immediately preceding backup of the same volume is deleted.
     *
     * Generated from protobuf field <code>int64 storage_bytes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getStorageBytes()
    {
        return $this->storage_bytes;
    }

    /**
     * Output only. The aggregate size of the underlying artifacts associated with this
     * VolumeBackup in the backup storage. This may change over time when
     * multiple backups of the same volume share the same backup storage
     * location. In particular, this is likely to increase in size when
     * the immediately preceding backup of the same volume is deleted.
     *
     * Generated from protobuf field <code>int64 storage_bytes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setStorageBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->storage_bytes = $var;

        return $this;
    }

    /**
     * Output only. The minimum size of the disk to which this VolumeBackup can be restored.
     *
     * Generated from protobuf field <code>int64 disk_size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getDiskSizeBytes()
    {
        return $this->disk_size_bytes;
    }

    /**
     * Output only. The minimum size of the disk to which this VolumeBackup can be restored.
     *
     * Generated from protobuf field <code>int64 disk_size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setDiskSizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->disk_size_bytes = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when the associated underlying volume backup
     * operation completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp complete_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCompleteTime()
    {
        return $this->complete_time;
    }

    public function hasCompleteTime()
    {
        return isset($this->complete_time);
    }

    public function clearCompleteTime()
    {
        unset($this->complete_time);
    }

    /**
     * Output only. The timestamp when the associated underlying volume backup
     * operation completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp complete_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCompleteTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->complete_time = $var;

        return $this;
    }

    /**
     * Output only. The current state of this VolumeBackup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The current state of this VolumeBackup.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.VolumeBackup.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\GkeBackup\V1\VolumeBackup\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. A human readable message explaining why the VolumeBackup is in its current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStateMessage()
    {
        return $this->state_message;
    }

    /**
     * Output only. A human readable message explaining why the VolumeBackup is in its current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStateMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->state_message = $var;

        return $this;
    }

    /**
     * Output only. `etag` is used for optimistic concurrency control as a way to help
     * prevent simultaneous updates of a volume backup from overwriting each
     * other. It is strongly suggested that systems make use of the `etag` in the
     * read-modify-write cycle to perform volume backup updates in order to avoid
     * race conditions.
     *
     * Generated from protobuf field <code>string etag = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * Output only. `etag` is used for optimistic concurrency control as a way to help
     * prevent simultaneous updates of a volume backup from overwriting each
     * other. It is strongly suggested that systems make use of the `etag` in the
     * read-modify-write cycle to perform volume backup updates in order to avoid
     * race conditions.
     *
     * Generated from protobuf field <code>string etag = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

}

