<?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;

/**
 * MaintenancePolicy defines the maintenance policy to be used for the cluster.
 *
 * Generated from protobuf message <code>google.container.v1.MaintenancePolicy</code>
 */
class MaintenancePolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies the maintenance window in which maintenance may be performed.
     *
     * Generated from protobuf field <code>.google.container.v1.MaintenanceWindow window = 1;</code>
     */
    private $window = null;
    /**
     * A hash identifying the version of this policy, so that updates to fields of
     * the policy won't accidentally undo intermediate changes (and so that users
     * of the API unaware of some fields won't accidentally remove other fields).
     * Make a `get()` request to the cluster to get the current
     * resource version and include it with requests to set the policy.
     *
     * Generated from protobuf field <code>string resource_version = 3;</code>
     */
    private $resource_version = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Container\V1\MaintenanceWindow $window
     *           Specifies the maintenance window in which maintenance may be performed.
     *     @type string $resource_version
     *           A hash identifying the version of this policy, so that updates to fields of
     *           the policy won't accidentally undo intermediate changes (and so that users
     *           of the API unaware of some fields won't accidentally remove other fields).
     *           Make a `get()` request to the cluster to get the current
     *           resource version and include it with requests to set the policy.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Specifies the maintenance window in which maintenance may be performed.
     *
     * Generated from protobuf field <code>.google.container.v1.MaintenanceWindow window = 1;</code>
     * @return \Google\Cloud\Container\V1\MaintenanceWindow|null
     */
    public function getWindow()
    {
        return isset($this->window) ? $this->window : null;
    }

    public function hasWindow()
    {
        return isset($this->window);
    }

    public function clearWindow()
    {
        unset($this->window);
    }

    /**
     * Specifies the maintenance window in which maintenance may be performed.
     *
     * Generated from protobuf field <code>.google.container.v1.MaintenanceWindow window = 1;</code>
     * @param \Google\Cloud\Container\V1\MaintenanceWindow $var
     * @return $this
     */
    public function setWindow($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MaintenanceWindow::class);
        $this->window = $var;

        return $this;
    }

    /**
     * A hash identifying the version of this policy, so that updates to fields of
     * the policy won't accidentally undo intermediate changes (and so that users
     * of the API unaware of some fields won't accidentally remove other fields).
     * Make a `get()` request to the cluster to get the current
     * resource version and include it with requests to set the policy.
     *
     * Generated from protobuf field <code>string resource_version = 3;</code>
     * @return string
     */
    public function getResourceVersion()
    {
        return $this->resource_version;
    }

    /**
     * A hash identifying the version of this policy, so that updates to fields of
     * the policy won't accidentally undo intermediate changes (and so that users
     * of the API unaware of some fields won't accidentally remove other fields).
     * Make a `get()` request to the cluster to get the current
     * resource version and include it with requests to set the policy.
     *
     * Generated from protobuf field <code>string resource_version = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setResourceVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_version = $var;

        return $this;
    }

}

