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

namespace Google\Cloud\VMMigration\V1;

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

/**
 * UpgradeStatus contains information about upgradeAppliance operation.
 *
 * Generated from protobuf message <code>google.cloud.vmmigration.v1.UpgradeStatus</code>
 */
class UpgradeStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * The version to upgrade to.
     *
     * Generated from protobuf field <code>string version = 1;</code>
     */
    private $version = '';
    /**
     * The state of the upgradeAppliance operation.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.UpgradeStatus.State state = 2;</code>
     */
    private $state = 0;
    /**
     * Provides details on the state of the upgrade operation in case of an error.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     */
    private $error = null;
    /**
     * The time the operation was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 4;</code>
     */
    private $start_time = null;
    /**
     * The version from which we upgraded.
     *
     * Generated from protobuf field <code>string previous_version = 5;</code>
     */
    private $previous_version = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $version
     *           The version to upgrade to.
     *     @type int $state
     *           The state of the upgradeAppliance operation.
     *     @type \Google\Rpc\Status $error
     *           Provides details on the state of the upgrade operation in case of an error.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The time the operation was started.
     *     @type string $previous_version
     *           The version from which we upgraded.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce();
        parent::__construct($data);
    }

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

    /**
     * The version to upgrade to.
     *
     * 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 state of the upgradeAppliance operation.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.UpgradeStatus.State state = 2;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the upgradeAppliance operation.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.UpgradeStatus.State state = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\UpgradeStatus\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Provides details on the state of the upgrade operation in case of an error.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * Provides details on the state of the upgrade operation in case of an error.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

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

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

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

        return $this;
    }

    /**
     * The version from which we upgraded.
     *
     * Generated from protobuf field <code>string previous_version = 5;</code>
     * @return string
     */
    public function getPreviousVersion()
    {
        return $this->previous_version;
    }

    /**
     * The version from which we upgraded.
     *
     * Generated from protobuf field <code>string previous_version = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setPreviousVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->previous_version = $var;

        return $this;
    }

}

