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

namespace Google\Cloud\Dataproc\V1;

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

/**
 * Cloud Dataproc job status.
 *
 * Generated from protobuf message <code>google.cloud.dataproc.v1.JobStatus</code>
 */
class JobStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * Output-only. A state message specifying the overall job state.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.State state = 1;</code>
     */
    private $state = 0;
    /**
     * Output-only. Optional job state details, such as an error
     * description if the state is <code>ERROR</code>.
     *
     * Generated from protobuf field <code>string details = 2;</code>
     */
    private $details = '';
    /**
     * Output-only. The time when this state was entered.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_start_time = 6;</code>
     */
    private $state_start_time = null;
    /**
     * Output-only. Additional state information, which includes
     * status reported by the agent.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.Substate substate = 7;</code>
     */
    private $substate = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $state
     *           Output-only. A state message specifying the overall job state.
     *     @type string $details
     *           Output-only. Optional job state details, such as an error
     *           description if the state is <code>ERROR</code>.
     *     @type \Google\Protobuf\Timestamp $state_start_time
     *           Output-only. The time when this state was entered.
     *     @type int $substate
     *           Output-only. Additional state information, which includes
     *           status reported by the agent.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataproc\V1\Jobs::initOnce();
        parent::__construct($data);
    }

    /**
     * Output-only. A state message specifying the overall job state.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.State state = 1;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output-only. A state message specifying the overall job state.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.State state = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataproc\V1\JobStatus_State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output-only. Optional job state details, such as an error
     * description if the state is <code>ERROR</code>.
     *
     * Generated from protobuf field <code>string details = 2;</code>
     * @return string
     */
    public function getDetails()
    {
        return $this->details;
    }

    /**
     * Output-only. Optional job state details, such as an error
     * description if the state is <code>ERROR</code>.
     *
     * Generated from protobuf field <code>string details = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDetails($var)
    {
        GPBUtil::checkString($var, True);
        $this->details = $var;

        return $this;
    }

    /**
     * Output-only. The time when this state was entered.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_start_time = 6;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getStateStartTime()
    {
        return $this->state_start_time;
    }

    /**
     * Output-only. The time when this state was entered.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_start_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStateStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->state_start_time = $var;

        return $this;
    }

    /**
     * Output-only. Additional state information, which includes
     * status reported by the agent.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.Substate substate = 7;</code>
     * @return int
     */
    public function getSubstate()
    {
        return $this->substate;
    }

    /**
     * Output-only. Additional state information, which includes
     * status reported by the agent.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.JobStatus.Substate substate = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setSubstate($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataproc\V1\JobStatus_Substate::class);
        $this->substate = $var;

        return $this;
    }

}

