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

namespace Google\Cloud\BareMetalSolution\V2\Volume;

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

/**
 * Details about snapshot space reservation and usage on the storage volume.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.Volume.SnapshotReservationDetail</code>
 */
class SnapshotReservationDetail extends \Google\Protobuf\Internal\Message
{
    /**
     * The space on this storage volume reserved for snapshots, shown in GiB.
     *
     * Generated from protobuf field <code>int64 reserved_space_gib = 1;</code>
     */
    private $reserved_space_gib = 0;
    /**
     * The percent of snapshot space on this storage volume actually being used
     * by the snapshot copies. This value might be higher than 100% if the
     * snapshot copies have overflowed into the data portion of the storage
     * volume.
     *
     * Generated from protobuf field <code>int32 reserved_space_used_percent = 2;</code>
     */
    private $reserved_space_used_percent = 0;
    /**
     * The amount, in GiB, of available space in this storage volume's reserved
     * snapshot space.
     *
     * Generated from protobuf field <code>int64 reserved_space_remaining_gib = 3;</code>
     */
    private $reserved_space_remaining_gib = 0;
    /**
     * Percent of the total Volume size reserved for snapshot copies.
     * Enabling snapshots requires reserving 20% or more of
     * the storage volume space for snapshots. Maximum reserved space for
     * snapshots is 40%.
     * Setting this field will effectively set snapshot_enabled to true.
     *
     * Generated from protobuf field <code>int32 reserved_space_percent = 4;</code>
     */
    private $reserved_space_percent = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $reserved_space_gib
     *           The space on this storage volume reserved for snapshots, shown in GiB.
     *     @type int $reserved_space_used_percent
     *           The percent of snapshot space on this storage volume actually being used
     *           by the snapshot copies. This value might be higher than 100% if the
     *           snapshot copies have overflowed into the data portion of the storage
     *           volume.
     *     @type int|string $reserved_space_remaining_gib
     *           The amount, in GiB, of available space in this storage volume's reserved
     *           snapshot space.
     *     @type int $reserved_space_percent
     *           Percent of the total Volume size reserved for snapshot copies.
     *           Enabling snapshots requires reserving 20% or more of
     *           the storage volume space for snapshots. Maximum reserved space for
     *           snapshots is 40%.
     *           Setting this field will effectively set snapshot_enabled to true.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Volume::initOnce();
        parent::__construct($data);
    }

    /**
     * The space on this storage volume reserved for snapshots, shown in GiB.
     *
     * Generated from protobuf field <code>int64 reserved_space_gib = 1;</code>
     * @return int|string
     */
    public function getReservedSpaceGib()
    {
        return $this->reserved_space_gib;
    }

    /**
     * The space on this storage volume reserved for snapshots, shown in GiB.
     *
     * Generated from protobuf field <code>int64 reserved_space_gib = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setReservedSpaceGib($var)
    {
        GPBUtil::checkInt64($var);
        $this->reserved_space_gib = $var;

        return $this;
    }

    /**
     * The percent of snapshot space on this storage volume actually being used
     * by the snapshot copies. This value might be higher than 100% if the
     * snapshot copies have overflowed into the data portion of the storage
     * volume.
     *
     * Generated from protobuf field <code>int32 reserved_space_used_percent = 2;</code>
     * @return int
     */
    public function getReservedSpaceUsedPercent()
    {
        return $this->reserved_space_used_percent;
    }

    /**
     * The percent of snapshot space on this storage volume actually being used
     * by the snapshot copies. This value might be higher than 100% if the
     * snapshot copies have overflowed into the data portion of the storage
     * volume.
     *
     * Generated from protobuf field <code>int32 reserved_space_used_percent = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setReservedSpaceUsedPercent($var)
    {
        GPBUtil::checkInt32($var);
        $this->reserved_space_used_percent = $var;

        return $this;
    }

    /**
     * The amount, in GiB, of available space in this storage volume's reserved
     * snapshot space.
     *
     * Generated from protobuf field <code>int64 reserved_space_remaining_gib = 3;</code>
     * @return int|string
     */
    public function getReservedSpaceRemainingGib()
    {
        return $this->reserved_space_remaining_gib;
    }

    /**
     * The amount, in GiB, of available space in this storage volume's reserved
     * snapshot space.
     *
     * Generated from protobuf field <code>int64 reserved_space_remaining_gib = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setReservedSpaceRemainingGib($var)
    {
        GPBUtil::checkInt64($var);
        $this->reserved_space_remaining_gib = $var;

        return $this;
    }

    /**
     * Percent of the total Volume size reserved for snapshot copies.
     * Enabling snapshots requires reserving 20% or more of
     * the storage volume space for snapshots. Maximum reserved space for
     * snapshots is 40%.
     * Setting this field will effectively set snapshot_enabled to true.
     *
     * Generated from protobuf field <code>int32 reserved_space_percent = 4;</code>
     * @return int
     */
    public function getReservedSpacePercent()
    {
        return $this->reserved_space_percent;
    }

    /**
     * Percent of the total Volume size reserved for snapshot copies.
     * Enabling snapshots requires reserving 20% or more of
     * the storage volume space for snapshots. Maximum reserved space for
     * snapshots is 40%.
     * Setting this field will effectively set snapshot_enabled to true.
     *
     * Generated from protobuf field <code>int32 reserved_space_percent = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setReservedSpacePercent($var)
    {
        GPBUtil::checkInt32($var);
        $this->reserved_space_percent = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SnapshotReservationDetail::class, \Google\Cloud\BareMetalSolution\V2\Volume_SnapshotReservationDetail::class);

