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

namespace Google\Cloud\Compute\V1;

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

/**
 * Time window specified for hourly operations.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.ResourcePolicyHourlyCycle</code>
 */
class ResourcePolicyHourlyCycle extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
     *
     * Generated from protobuf field <code>optional string duration = 155471252;</code>
     */
    private $duration = null;
    /**
     * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
     *
     * Generated from protobuf field <code>optional int32 hours_in_cycle = 526763132;</code>
     */
    private $hours_in_cycle = null;
    /**
     * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     */
    private $start_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $duration
     *           [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
     *     @type int $hours_in_cycle
     *           Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
     *     @type string $start_time
     *           Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
     *
     * Generated from protobuf field <code>optional string duration = 155471252;</code>
     * @return string
     */
    public function getDuration()
    {
        return isset($this->duration) ? $this->duration : '';
    }

    public function hasDuration()
    {
        return isset($this->duration);
    }

    public function clearDuration()
    {
        unset($this->duration);
    }

    /**
     * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
     *
     * Generated from protobuf field <code>optional string duration = 155471252;</code>
     * @param string $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkString($var, True);
        $this->duration = $var;

        return $this;
    }

    /**
     * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
     *
     * Generated from protobuf field <code>optional int32 hours_in_cycle = 526763132;</code>
     * @return int
     */
    public function getHoursInCycle()
    {
        return isset($this->hours_in_cycle) ? $this->hours_in_cycle : 0;
    }

    public function hasHoursInCycle()
    {
        return isset($this->hours_in_cycle);
    }

    public function clearHoursInCycle()
    {
        unset($this->hours_in_cycle);
    }

    /**
     * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
     *
     * Generated from protobuf field <code>optional int32 hours_in_cycle = 526763132;</code>
     * @param int $var
     * @return $this
     */
    public function setHoursInCycle($var)
    {
        GPBUtil::checkInt32($var);
        $this->hours_in_cycle = $var;

        return $this;
    }

    /**
     * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     * @return string
     */
    public function getStartTime()
    {
        return isset($this->start_time) ? $this->start_time : '';
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     * @param string $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkString($var, True);
        $this->start_time = $var;

        return $this;
    }

}

