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

namespace Google\Cloud\Memcache\V1beta2;

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

/**
 * Time window specified for weekly operations.
 *
 * Generated from protobuf message <code>google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow</code>
 */
class WeeklyMaintenanceWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Allows to define schedule that runs specified day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $day = 0;
    /**
     * Required. Start time of the window in UTC.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $start_time = null;
    /**
     * Required. Duration of the time window.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $day
     *           Required. Allows to define schedule that runs specified day of the week.
     *     @type \Google\Type\TimeOfDay $start_time
     *           Required. Start time of the window in UTC.
     *     @type \Google\Protobuf\Duration $duration
     *           Required. Duration of the time window.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memcache\V1Beta2\CloudMemcache::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Allows to define schedule that runs specified day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDay()
    {
        return $this->day;
    }

    /**
     * Required. Allows to define schedule that runs specified day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDay($var)
    {
        GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class);
        $this->day = $var;

        return $this;
    }

    /**
     * Required. Start time of the window in UTC.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Type\TimeOfDay|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

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

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

    /**
     * Required. Start time of the window in UTC.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Type\TimeOfDay $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Required. Duration of the time window.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDuration()
    {
        return $this->duration;
    }

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

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

    /**
     * Required. Duration of the time window.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->duration = $var;

        return $this;
    }

}

