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

/**
 * 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 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Optional. Output only. Job state details, such as an error
     * description if the state is <code>ERROR</code>.
     *
     * Generated from protobuf field <code>string details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $details = '';
    /**
     * Output only. The time when this state was entered.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp state_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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
     *           Optional. Output only. 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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
    }

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

    /**
     * Optional. Output only. Job state details, such as an error
     * description if the state is <code>ERROR</code>.
     *
     * Generated from protobuf field <code>string details = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</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 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getStateStartTime()
    {
        return isset($this->state_start_time) ? $this->state_start_time : null;
    }

    public function hasStateStartTime()
    {
        return isset($this->state_start_time);
    }

    public function clearStateStartTime()
    {
        unset($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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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 [(.google.api.field_behavior) = OUTPUT_ONLY];</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;
    }

}

