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

namespace Google\Cloud\Deploy\V1;

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

/**
 * Weekly windows. For example, blocking actions every Saturday and Sunday.
 * Another example would be blocking actions every weekday from 5pm to midnight.
 *
 * Generated from protobuf message <code>google.cloud.deploy.v1.WeeklyWindow</code>
 */
class WeeklyWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Days of week. If left empty, all days of the week will be
     * included.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $days_of_week;
    /**
     * Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
     * If you specify start_time you must also specify end_time. If left empty,
     * this will block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $start_time = null;
    /**
     * Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
     * specify end_time you must also specify start_time. If left empty, this will
     * block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay end_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $end_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $days_of_week
     *           Optional. Days of week. If left empty, all days of the week will be
     *           included.
     *     @type \Google\Type\TimeOfDay $start_time
     *           Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
     *           If you specify start_time you must also specify end_time. If left empty,
     *           this will block for the entire day for the days specified in days_of_week.
     *     @type \Google\Type\TimeOfDay $end_time
     *           Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
     *           specify end_time you must also specify start_time. If left empty, this will
     *           block for the entire day for the days specified in days_of_week.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Days of week. If left empty, all days of the week will be
     * included.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDaysOfWeek()
    {
        return $this->days_of_week;
    }

    /**
     * Optional. Days of week. If left empty, all days of the week will be
     * included.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDaysOfWeek($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class);
        $this->days_of_week = $arr;

        return $this;
    }

    /**
     * Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
     * If you specify start_time you must also specify end_time. If left empty,
     * this will block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = OPTIONAL];</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);
    }

    /**
     * Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
     * If you specify start_time you must also specify end_time. If left empty,
     * this will block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay start_time = 2 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

    /**
     * Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
     * specify end_time you must also specify start_time. If left empty, this will
     * block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay end_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Type\TimeOfDay|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
     * specify end_time you must also specify start_time. If left empty, this will
     * block for the entire day for the days specified in days_of_week.
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay end_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Type\TimeOfDay $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class);
        $this->end_time = $var;

        return $this;
    }

}

