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

namespace Google\Cloud\NetApp\V1;

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

/**
 * Defines tiering policy for the volume.
 *
 * Generated from protobuf message <code>google.cloud.netapp.v1.TieringPolicy</code>
 */
class TieringPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Flag indicating if the volume has tiering policy enable/pause.
     * Default is PAUSED.
     *
     * Generated from protobuf field <code>optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $tier_action = null;
    /**
     * Optional. Time in days to mark the volume's data block as cold and make it
     * eligible for tiering, can be range from 7-183. Default is 31.
     *
     * Generated from protobuf field <code>optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $cooling_threshold_days = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $tier_action
     *           Optional. Flag indicating if the volume has tiering policy enable/pause.
     *           Default is PAUSED.
     *     @type int $cooling_threshold_days
     *           Optional. Time in days to mark the volume's data block as cold and make it
     *           eligible for tiering, can be range from 7-183. Default is 31.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Netapp\V1\Volume::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Flag indicating if the volume has tiering policy enable/pause.
     * Default is PAUSED.
     *
     * Generated from protobuf field <code>optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getTierAction()
    {
        return isset($this->tier_action) ? $this->tier_action : 0;
    }

    public function hasTierAction()
    {
        return isset($this->tier_action);
    }

    public function clearTierAction()
    {
        unset($this->tier_action);
    }

    /**
     * Optional. Flag indicating if the volume has tiering policy enable/pause.
     * Default is PAUSED.
     *
     * Generated from protobuf field <code>optional .google.cloud.netapp.v1.TieringPolicy.TierAction tier_action = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setTierAction($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetApp\V1\TieringPolicy\TierAction::class);
        $this->tier_action = $var;

        return $this;
    }

    /**
     * Optional. Time in days to mark the volume's data block as cold and make it
     * eligible for tiering, can be range from 7-183. Default is 31.
     *
     * Generated from protobuf field <code>optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getCoolingThresholdDays()
    {
        return isset($this->cooling_threshold_days) ? $this->cooling_threshold_days : 0;
    }

    public function hasCoolingThresholdDays()
    {
        return isset($this->cooling_threshold_days);
    }

    public function clearCoolingThresholdDays()
    {
        unset($this->cooling_threshold_days);
    }

    /**
     * Optional. Time in days to mark the volume's data block as cold and make it
     * eligible for tiering, can be range from 7-183. Default is 31.
     *
     * Generated from protobuf field <code>optional int32 cooling_threshold_days = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setCoolingThresholdDays($var)
    {
        GPBUtil::checkInt32($var);
        $this->cooling_threshold_days = $var;

        return $this;
    }

}

