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

/**
 * UpgradeAvailableEvent is a notification sent to customers when a new
 * available version is released.
 *
 * Generated from protobuf message <code>google.container.v1.UpgradeAvailableEvent</code>
 */
class UpgradeAvailableEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * The release version available for upgrade.
     *
     * Generated from protobuf field <code>string version = 1;</code>
     */
    private $version = '';
    /**
     * The resource type of the release version.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 2;</code>
     */
    private $resource_type = 0;
    /**
     * The release channel of the version. If empty, it means a non-channel
     * release.
     *
     * Generated from protobuf field <code>.google.container.v1.ReleaseChannel release_channel = 3;</code>
     */
    private $release_channel = null;
    /**
     * Optional relative path to the resource. For example, the relative path of
     * the node pool.
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     */
    private $resource = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $version
     *           The release version available for upgrade.
     *     @type int $resource_type
     *           The resource type of the release version.
     *     @type \Google\Cloud\Container\V1\ReleaseChannel $release_channel
     *           The release channel of the version. If empty, it means a non-channel
     *           release.
     *     @type string $resource
     *           Optional relative path to the resource. For example, the relative path of
     *           the node pool.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * The release version available for upgrade.
     *
     * Generated from protobuf field <code>string version = 1;</code>
     * @return string
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * The release version available for upgrade.
     *
     * Generated from protobuf field <code>string version = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->version = $var;

        return $this;
    }

    /**
     * The resource type of the release version.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 2;</code>
     * @return int
     */
    public function getResourceType()
    {
        return $this->resource_type;
    }

    /**
     * The resource type of the release version.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setResourceType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\UpgradeResourceType::class);
        $this->resource_type = $var;

        return $this;
    }

    /**
     * The release channel of the version. If empty, it means a non-channel
     * release.
     *
     * Generated from protobuf field <code>.google.container.v1.ReleaseChannel release_channel = 3;</code>
     * @return \Google\Cloud\Container\V1\ReleaseChannel|null
     */
    public function getReleaseChannel()
    {
        return $this->release_channel;
    }

    public function hasReleaseChannel()
    {
        return isset($this->release_channel);
    }

    public function clearReleaseChannel()
    {
        unset($this->release_channel);
    }

    /**
     * The release channel of the version. If empty, it means a non-channel
     * release.
     *
     * Generated from protobuf field <code>.google.container.v1.ReleaseChannel release_channel = 3;</code>
     * @param \Google\Cloud\Container\V1\ReleaseChannel $var
     * @return $this
     */
    public function setReleaseChannel($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ReleaseChannel::class);
        $this->release_channel = $var;

        return $this;
    }

    /**
     * Optional relative path to the resource. For example, the relative path of
     * the node pool.
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     * @return string
     */
    public function getResource()
    {
        return $this->resource;
    }

    /**
     * Optional relative path to the resource. For example, the relative path of
     * the node pool.
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource = $var;

        return $this;
    }

}

