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

/**
 * CutoverJob message describes a cutover of a migrating VM. The CutoverJob is
 * the operation of shutting down the VM, creating a snapshot and
 * clonning the VM using the replicated snapshot.
 *
 * Generated from protobuf message <code>google.cloud.vmmigration.v1.CutoverJob</code>
 */
class CutoverJob extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The time the cutover job was created (as an API call, not when
     * it was actually created in the target).
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The time the cutover job had finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $end_time = null;
    /**
     * Output only. The name of the cutover job.
     *
     * Generated from protobuf field <code>string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. State of the cutover job.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.CutoverJob.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. The time the state was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state_time = null;
    /**
     * Output only. The current progress in percentage of the cutover job.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $progress_percent = 0;
    /**
     * Output only. Provides details for the errors that led to the Cutover Job's
     * state.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $error = null;
    /**
     * Output only. A message providing possible extra details about the current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state_message = '';
    /**
     * Output only. The cutover steps list representing its progress.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.CutoverStep steps = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $steps;
    protected $target_vm_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails $compute_engine_target_details
     *           Output only. Details of the target VM in Compute Engine.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time the cutover job was created (as an API call, not when
     *           it was actually created in the target).
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Output only. The time the cutover job had finished.
     *     @type string $name
     *           Output only. The name of the cutover job.
     *     @type int $state
     *           Output only. State of the cutover job.
     *     @type \Google\Protobuf\Timestamp $state_time
     *           Output only. The time the state was last updated.
     *     @type int $progress_percent
     *           Output only. The current progress in percentage of the cutover job.
     *     @type \Google\Rpc\Status $error
     *           Output only. Provides details for the errors that led to the Cutover Job's
     *           state.
     *     @type string $state_message
     *           Output only. A message providing possible extra details about the current
     *           state.
     *     @type array<\Google\Cloud\VMMigration\V1\CutoverStep>|\Google\Protobuf\Internal\RepeatedField $steps
     *           Output only. The cutover steps list representing its progress.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Details of the target VM in Compute Engine.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeEngineTargetDetails compute_engine_target_details = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails|null
     */
    public function getComputeEngineTargetDetails()
    {
        return $this->readOneof(14);
    }

    public function hasComputeEngineTargetDetails()
    {
        return $this->hasOneof(14);
    }

    /**
     * Output only. Details of the target VM in Compute Engine.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeEngineTargetDetails compute_engine_target_details = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails $var
     * @return $this
     */
    public function setComputeEngineTargetDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * Output only. The time the cutover job was created (as an API call, not when
     * it was actually created in the target).
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time the cutover job was created (as an API call, not when
     * it was actually created in the target).
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time the cutover job had finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Output only. The time the cutover job had finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Output only. The name of the cutover job.
     *
     * Generated from protobuf field <code>string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The name of the cutover job.
     *
     * Generated from protobuf field <code>string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. State of the cutover job.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.CutoverJob.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. State of the cutover job.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.CutoverJob.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\CutoverJob\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The time the state was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStateTime()
    {
        return $this->state_time;
    }

    public function hasStateTime()
    {
        return isset($this->state_time);
    }

    public function clearStateTime()
    {
        unset($this->state_time);
    }

    /**
     * Output only. The time the state was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->state_time = $var;

        return $this;
    }

    /**
     * Output only. The current progress in percentage of the cutover job.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getProgressPercent()
    {
        return $this->progress_percent;
    }

    /**
     * Output only. The current progress in percentage of the cutover job.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setProgressPercent($var)
    {
        GPBUtil::checkInt32($var);
        $this->progress_percent = $var;

        return $this;
    }

    /**
     * Output only. Provides details for the errors that led to the Cutover Job's
     * state.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</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);
    }

    /**
     * Output only. Provides details for the errors that led to the Cutover Job's
     * state.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

    /**
     * Output only. A message providing possible extra details about the current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStateMessage()
    {
        return $this->state_message;
    }

    /**
     * Output only. A message providing possible extra details about the current
     * state.
     *
     * Generated from protobuf field <code>string state_message = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStateMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->state_message = $var;

        return $this;
    }

    /**
     * Output only. The cutover steps list representing its progress.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.CutoverStep steps = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSteps()
    {
        return $this->steps;
    }

    /**
     * Output only. The cutover steps list representing its progress.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.CutoverStep steps = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\VMMigration\V1\CutoverStep>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSteps($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\CutoverStep::class);
        $this->steps = $arr;

        return $this;
    }

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

}

