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

namespace Google\Cloud\Dataplex\V1;

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

/**
 * The payload associated with Job logs that contains events describing jobs
 * that have run within a Lake.
 *
 * Generated from protobuf message <code>google.cloud.dataplex.v1.JobEvent</code>
 */
class JobEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * The log message.
     *
     * Generated from protobuf field <code>string message = 1;</code>
     */
    private $message = '';
    /**
     * The unique id identifying the job.
     *
     * Generated from protobuf field <code>string job_id = 2;</code>
     */
    private $job_id = '';
    /**
     * The time when the job started running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    private $start_time = null;
    /**
     * The time when the job ended running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 4;</code>
     */
    private $end_time = null;
    /**
     * The job state on completion.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.State state = 5;</code>
     */
    private $state = 0;
    /**
     * The number of retries.
     *
     * Generated from protobuf field <code>int32 retries = 6;</code>
     */
    private $retries = 0;
    /**
     * The type of the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Type type = 7;</code>
     */
    private $type = 0;
    /**
     * The service used to execute the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Service service = 8;</code>
     */
    private $service = 0;
    /**
     * The reference to the job within the service.
     *
     * Generated from protobuf field <code>string service_job = 9;</code>
     */
    private $service_job = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $message
     *           The log message.
     *     @type string $job_id
     *           The unique id identifying the job.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The time when the job started running.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The time when the job ended running.
     *     @type int $state
     *           The job state on completion.
     *     @type int $retries
     *           The number of retries.
     *     @type int $type
     *           The type of the job.
     *     @type int $service
     *           The service used to execute the job.
     *     @type string $service_job
     *           The reference to the job within the service.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataplex\V1\Logs::initOnce();
        parent::__construct($data);
    }

    /**
     * The log message.
     *
     * Generated from protobuf field <code>string message = 1;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * The log message.
     *
     * Generated from protobuf field <code>string message = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->message = $var;

        return $this;
    }

    /**
     * The unique id identifying the job.
     *
     * Generated from protobuf field <code>string job_id = 2;</code>
     * @return string
     */
    public function getJobId()
    {
        return $this->job_id;
    }

    /**
     * The unique id identifying the job.
     *
     * Generated from protobuf field <code>string job_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setJobId($var)
    {
        GPBUtil::checkString($var, True);
        $this->job_id = $var;

        return $this;
    }

    /**
     * The time when the job started running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</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 when the job started running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</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 time when the job ended running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 4;</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);
    }

    /**
     * The time when the job ended running.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 4;</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;
    }

    /**
     * The job state on completion.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.State state = 5;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The job state on completion.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.State state = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataplex\V1\JobEvent\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The number of retries.
     *
     * Generated from protobuf field <code>int32 retries = 6;</code>
     * @return int
     */
    public function getRetries()
    {
        return $this->retries;
    }

    /**
     * The number of retries.
     *
     * Generated from protobuf field <code>int32 retries = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setRetries($var)
    {
        GPBUtil::checkInt32($var);
        $this->retries = $var;

        return $this;
    }

    /**
     * The type of the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Type type = 7;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The type of the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Type type = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataplex\V1\JobEvent\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * The service used to execute the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Service service = 8;</code>
     * @return int
     */
    public function getService()
    {
        return $this->service;
    }

    /**
     * The service used to execute the job.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.JobEvent.Service service = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setService($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataplex\V1\JobEvent\Service::class);
        $this->service = $var;

        return $this;
    }

    /**
     * The reference to the job within the service.
     *
     * Generated from protobuf field <code>string service_job = 9;</code>
     * @return string
     */
    public function getServiceJob()
    {
        return $this->service_job;
    }

    /**
     * The reference to the job within the service.
     *
     * Generated from protobuf field <code>string service_job = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setServiceJob($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_job = $var;

        return $this;
    }

}

