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

namespace Google\Cloud\Container\V1;

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

/**
 * MaintenanceWindow defines the maintenance window to be used for the cluster.
 *
 * Generated from protobuf message <code>google.container.v1.MaintenanceWindow</code>
 */
class MaintenanceWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Exceptions to maintenance window. Non-emergency maintenance should not
     * occur in these windows.
     *
     * Generated from protobuf field <code>map<string, .google.container.v1.TimeWindow> maintenance_exclusions = 4;</code>
     */
    private $maintenance_exclusions;
    protected $policy;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Container\V1\DailyMaintenanceWindow $daily_maintenance_window
     *           DailyMaintenanceWindow specifies a daily maintenance operation window.
     *     @type \Google\Cloud\Container\V1\RecurringTimeWindow $recurring_window
     *           RecurringWindow specifies some number of recurring time periods for
     *           maintenance to occur. The time windows may be overlapping. If no
     *           maintenance windows are set, maintenance can occur at any time.
     *     @type array|\Google\Protobuf\Internal\MapField $maintenance_exclusions
     *           Exceptions to maintenance window. Non-emergency maintenance should not
     *           occur in these windows.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * DailyMaintenanceWindow specifies a daily maintenance operation window.
     *
     * Generated from protobuf field <code>.google.container.v1.DailyMaintenanceWindow daily_maintenance_window = 2;</code>
     * @return \Google\Cloud\Container\V1\DailyMaintenanceWindow|null
     */
    public function getDailyMaintenanceWindow()
    {
        return $this->readOneof(2);
    }

    public function hasDailyMaintenanceWindow()
    {
        return $this->hasOneof(2);
    }

    /**
     * DailyMaintenanceWindow specifies a daily maintenance operation window.
     *
     * Generated from protobuf field <code>.google.container.v1.DailyMaintenanceWindow daily_maintenance_window = 2;</code>
     * @param \Google\Cloud\Container\V1\DailyMaintenanceWindow $var
     * @return $this
     */
    public function setDailyMaintenanceWindow($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\DailyMaintenanceWindow::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * RecurringWindow specifies some number of recurring time periods for
     * maintenance to occur. The time windows may be overlapping. If no
     * maintenance windows are set, maintenance can occur at any time.
     *
     * Generated from protobuf field <code>.google.container.v1.RecurringTimeWindow recurring_window = 3;</code>
     * @return \Google\Cloud\Container\V1\RecurringTimeWindow|null
     */
    public function getRecurringWindow()
    {
        return $this->readOneof(3);
    }

    public function hasRecurringWindow()
    {
        return $this->hasOneof(3);
    }

    /**
     * RecurringWindow specifies some number of recurring time periods for
     * maintenance to occur. The time windows may be overlapping. If no
     * maintenance windows are set, maintenance can occur at any time.
     *
     * Generated from protobuf field <code>.google.container.v1.RecurringTimeWindow recurring_window = 3;</code>
     * @param \Google\Cloud\Container\V1\RecurringTimeWindow $var
     * @return $this
     */
    public function setRecurringWindow($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\RecurringTimeWindow::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Exceptions to maintenance window. Non-emergency maintenance should not
     * occur in these windows.
     *
     * Generated from protobuf field <code>map<string, .google.container.v1.TimeWindow> maintenance_exclusions = 4;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getMaintenanceExclusions()
    {
        return $this->maintenance_exclusions;
    }

    /**
     * Exceptions to maintenance window. Non-emergency maintenance should not
     * occur in these windows.
     *
     * Generated from protobuf field <code>map<string, .google.container.v1.TimeWindow> maintenance_exclusions = 4;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setMaintenanceExclusions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\TimeWindow::class);
        $this->maintenance_exclusions = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getPolicy()
    {
        return $this->whichOneof("policy");
    }

}

