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

/**
 * UpgradeEvent is a notification sent to customers by the cluster server when
 * a resource is upgrading.
 *
 * Generated from protobuf message <code>google.container.v1.UpgradeEvent</code>
 */
class UpgradeEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource type that is upgrading.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 1;</code>
     */
    private $resource_type = 0;
    /**
     * The operation associated with this upgrade.
     *
     * Generated from protobuf field <code>string operation = 2;</code>
     */
    private $operation = '';
    /**
     * The time when the operation was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp operation_start_time = 3;</code>
     */
    private $operation_start_time = null;
    /**
     * The current version before the upgrade.
     *
     * Generated from protobuf field <code>string current_version = 4;</code>
     */
    private $current_version = '';
    /**
     * The target version for the upgrade.
     *
     * Generated from protobuf field <code>string target_version = 5;</code>
     */
    private $target_version = '';
    /**
     * Optional relative path to the resource. For example in node pool upgrades,
     * the relative path of the node pool.
     *
     * Generated from protobuf field <code>string resource = 6;</code>
     */
    private $resource = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $resource_type
     *           The resource type that is upgrading.
     *     @type string $operation
     *           The operation associated with this upgrade.
     *     @type \Google\Protobuf\Timestamp $operation_start_time
     *           The time when the operation was started.
     *     @type string $current_version
     *           The current version before the upgrade.
     *     @type string $target_version
     *           The target version for the upgrade.
     *     @type string $resource
     *           Optional relative path to the resource. For example in node pool upgrades,
     *           the relative path of the node pool.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource type that is upgrading.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 1;</code>
     * @return int
     */
    public function getResourceType()
    {
        return $this->resource_type;
    }

    /**
     * The resource type that is upgrading.
     *
     * Generated from protobuf field <code>.google.container.v1.UpgradeResourceType resource_type = 1;</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 operation associated with this upgrade.
     *
     * Generated from protobuf field <code>string operation = 2;</code>
     * @return string
     */
    public function getOperation()
    {
        return $this->operation;
    }

    /**
     * The operation associated with this upgrade.
     *
     * Generated from protobuf field <code>string operation = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setOperation($var)
    {
        GPBUtil::checkString($var, True);
        $this->operation = $var;

        return $this;
    }

    /**
     * The time when the operation was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp operation_start_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getOperationStartTime()
    {
        return $this->operation_start_time;
    }

    public function hasOperationStartTime()
    {
        return isset($this->operation_start_time);
    }

    public function clearOperationStartTime()
    {
        unset($this->operation_start_time);
    }

    /**
     * The time when the operation was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp operation_start_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setOperationStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->operation_start_time = $var;

        return $this;
    }

    /**
     * The current version before the upgrade.
     *
     * Generated from protobuf field <code>string current_version = 4;</code>
     * @return string
     */
    public function getCurrentVersion()
    {
        return $this->current_version;
    }

    /**
     * The current version before the upgrade.
     *
     * Generated from protobuf field <code>string current_version = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setCurrentVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->current_version = $var;

        return $this;
    }

    /**
     * The target version for the upgrade.
     *
     * Generated from protobuf field <code>string target_version = 5;</code>
     * @return string
     */
    public function getTargetVersion()
    {
        return $this->target_version;
    }

    /**
     * The target version for the upgrade.
     *
     * Generated from protobuf field <code>string target_version = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setTargetVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->target_version = $var;

        return $this;
    }

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

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

        return $this;
    }

}

