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

namespace Google\Cloud\Batch\V1;

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

/**
 * This Task Execution field includes detail information for
 * task execution procedures, based on StatusEvent types.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.TaskExecution</code>
 */
class TaskExecution extends \Google\Protobuf\Internal\Message
{
    /**
     * When task is completed as the status of FAILED or SUCCEEDED,
     * exit code is for one task execution result, default is 0 as success.
     *
     * Generated from protobuf field <code>int32 exit_code = 1;</code>
     */
    private $exit_code = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $exit_code
     *           When task is completed as the status of FAILED or SUCCEEDED,
     *           exit code is for one task execution result, default is 0 as success.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce();
        parent::__construct($data);
    }

    /**
     * When task is completed as the status of FAILED or SUCCEEDED,
     * exit code is for one task execution result, default is 0 as success.
     *
     * Generated from protobuf field <code>int32 exit_code = 1;</code>
     * @return int
     */
    public function getExitCode()
    {
        return $this->exit_code;
    }

    /**
     * When task is completed as the status of FAILED or SUCCEEDED,
     * exit code is for one task execution result, default is 0 as success.
     *
     * Generated from protobuf field <code>int32 exit_code = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setExitCode($var)
    {
        GPBUtil::checkInt32($var);
        $this->exit_code = $var;

        return $this;
    }

}

