<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/baremetalsolution/v2/volume_snapshot.proto

namespace Google\Cloud\BareMetalSolution\V2;

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

/**
 * A snapshot of a volume. Only boot volumes can have snapshots.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.VolumeSnapshot</code>
 */
class VolumeSnapshot extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the snapshot.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Output only. An identifier for the snapshot, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $id = '';
    /**
     * The description of the snapshot.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     */
    protected $description = '';
    /**
     * Output only. The creation time of the snapshot.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The name of the volume which this snapshot belongs to.
     *
     * Generated from protobuf field <code>string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    protected $storage_volume = '';
    /**
     * Output only. The type of the snapshot which indicates whether it was
     * scheduled or manual/ad-hoc.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the snapshot.
     *     @type string $id
     *           Output only. An identifier for the snapshot, generated by the backend.
     *     @type string $description
     *           The description of the snapshot.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The creation time of the snapshot.
     *     @type string $storage_volume
     *           Output only. The name of the volume which this snapshot belongs to.
     *     @type int $type
     *           Output only. The type of the snapshot which indicates whether it was
     *           scheduled or manual/ad-hoc.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\VolumeSnapshot::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the snapshot.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

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

        return $this;
    }

    /**
     * Output only. An identifier for the snapshot, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Output only. An identifier for the snapshot, generated by the backend.
     *
     * Generated from protobuf field <code>string id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The description of the snapshot.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * The description of the snapshot.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. The creation time of the snapshot.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.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 creation time of the snapshot.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.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 name of the volume which this snapshot belongs to.
     *
     * Generated from protobuf field <code>string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getStorageVolume()
    {
        return $this->storage_volume;
    }

    /**
     * Output only. The name of the volume which this snapshot belongs to.
     *
     * Generated from protobuf field <code>string storage_volume = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setStorageVolume($var)
    {
        GPBUtil::checkString($var, True);
        $this->storage_volume = $var;

        return $this;
    }

    /**
     * Output only. The type of the snapshot which indicates whether it was
     * scheduled or manual/ad-hoc.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Output only. The type of the snapshot which indicates whether it was
     * scheduled or manual/ad-hoc.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeSnapshot.SnapshotType type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeSnapshot\SnapshotType::class);
        $this->type = $var;

        return $this;
    }

}

