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

namespace Google\Cloud\CloudDms\V1;

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

/**
 * Execution log of a background job.
 *
 * Generated from protobuf message <code>google.cloud.clouddms.v1.BackgroundJobLogEntry</code>
 */
class BackgroundJobLogEntry extends \Google\Protobuf\Internal\Message
{
    /**
     * The background job log entry ID.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    private $id = '';
    /**
     * The type of job that was executed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobType job_type = 2;</code>
     */
    private $job_type = 0;
    /**
     * The timestamp when the background job was started.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    private $start_time = null;
    /**
     * The timestamp when the background job was finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp finish_time = 4;</code>
     */
    private $finish_time = null;
    /**
     * Output only. Job completion state, i.e. the final state after the job
     * completed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState completion_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $completion_state = 0;
    /**
     * Output only. Job completion comment, such as how many entities were seeded,
     * how many warnings were found during conversion, and similar information.
     *
     * Generated from protobuf field <code>string completion_comment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $completion_comment = '';
    /**
     * Output only. Whether the client requested the conversion workspace to be
     * committed after a successful completion of the job.
     *
     * Generated from protobuf field <code>bool request_autocommit = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $request_autocommit = false;
    protected $job_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           The background job log entry ID.
     *     @type int $job_type
     *           The type of job that was executed.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The timestamp when the background job was started.
     *     @type \Google\Protobuf\Timestamp $finish_time
     *           The timestamp when the background job was finished.
     *     @type int $completion_state
     *           Output only. Job completion state, i.e. the final state after the job
     *           completed.
     *     @type string $completion_comment
     *           Output only. Job completion comment, such as how many entities were seeded,
     *           how many warnings were found during conversion, and similar information.
     *     @type bool $request_autocommit
     *           Output only. Whether the client requested the conversion workspace to be
     *           committed after a successful completion of the job.
     *     @type \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\SeedJobDetails $seed_job_details
     *           Output only. Seed job details.
     *     @type \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ImportRulesJobDetails $import_rules_job_details
     *           Output only. Import rules job details.
     *     @type \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ConvertJobDetails $convert_job_details
     *           Output only. Convert job details.
     *     @type \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ApplyJobDetails $apply_job_details
     *           Output only. Apply job details.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Clouddms\V1\ConversionworkspaceResources::initOnce();
        parent::__construct($data);
    }

    /**
     * The background job log entry ID.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

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

        return $this;
    }

    /**
     * The type of job that was executed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobType job_type = 2;</code>
     * @return int
     */
    public function getJobType()
    {
        return $this->job_type;
    }

    /**
     * The type of job that was executed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobType job_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setJobType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\CloudDms\V1\BackgroundJobType::class);
        $this->job_type = $var;

        return $this;
    }

    /**
     * The timestamp when the background job was started.
     *
     * 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 timestamp when the background job was started.
     *
     * 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 timestamp when the background job was finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp finish_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getFinishTime()
    {
        return $this->finish_time;
    }

    public function hasFinishTime()
    {
        return isset($this->finish_time);
    }

    public function clearFinishTime()
    {
        unset($this->finish_time);
    }

    /**
     * The timestamp when the background job was finished.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp finish_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setFinishTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->finish_time = $var;

        return $this;
    }

    /**
     * Output only. Job completion state, i.e. the final state after the job
     * completed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState completion_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getCompletionState()
    {
        return $this->completion_state;
    }

    /**
     * Output only. Job completion state, i.e. the final state after the job
     * completed.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState completion_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setCompletionState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\JobCompletionState::class);
        $this->completion_state = $var;

        return $this;
    }

    /**
     * Output only. Job completion comment, such as how many entities were seeded,
     * how many warnings were found during conversion, and similar information.
     *
     * Generated from protobuf field <code>string completion_comment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getCompletionComment()
    {
        return $this->completion_comment;
    }

    /**
     * Output only. Job completion comment, such as how many entities were seeded,
     * how many warnings were found during conversion, and similar information.
     *
     * Generated from protobuf field <code>string completion_comment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setCompletionComment($var)
    {
        GPBUtil::checkString($var, True);
        $this->completion_comment = $var;

        return $this;
    }

    /**
     * Output only. Whether the client requested the conversion workspace to be
     * committed after a successful completion of the job.
     *
     * Generated from protobuf field <code>bool request_autocommit = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getRequestAutocommit()
    {
        return $this->request_autocommit;
    }

    /**
     * Output only. Whether the client requested the conversion workspace to be
     * committed after a successful completion of the job.
     *
     * Generated from protobuf field <code>bool request_autocommit = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setRequestAutocommit($var)
    {
        GPBUtil::checkBool($var);
        $this->request_autocommit = $var;

        return $this;
    }

    /**
     * Output only. Seed job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails seed_job_details = 100 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\SeedJobDetails|null
     */
    public function getSeedJobDetails()
    {
        return $this->readOneof(100);
    }

    public function hasSeedJobDetails()
    {
        return $this->hasOneof(100);
    }

    /**
     * Output only. Seed job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails seed_job_details = 100 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\SeedJobDetails $var
     * @return $this
     */
    public function setSeedJobDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\SeedJobDetails::class);
        $this->writeOneof(100, $var);

        return $this;
    }

    /**
     * Output only. Import rules job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails import_rules_job_details = 101 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ImportRulesJobDetails|null
     */
    public function getImportRulesJobDetails()
    {
        return $this->readOneof(101);
    }

    public function hasImportRulesJobDetails()
    {
        return $this->hasOneof(101);
    }

    /**
     * Output only. Import rules job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails import_rules_job_details = 101 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ImportRulesJobDetails $var
     * @return $this
     */
    public function setImportRulesJobDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ImportRulesJobDetails::class);
        $this->writeOneof(101, $var);

        return $this;
    }

    /**
     * Output only. Convert job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails convert_job_details = 102 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ConvertJobDetails|null
     */
    public function getConvertJobDetails()
    {
        return $this->readOneof(102);
    }

    public function hasConvertJobDetails()
    {
        return $this->hasOneof(102);
    }

    /**
     * Output only. Convert job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails convert_job_details = 102 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ConvertJobDetails $var
     * @return $this
     */
    public function setConvertJobDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ConvertJobDetails::class);
        $this->writeOneof(102, $var);

        return $this;
    }

    /**
     * Output only. Apply job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails apply_job_details = 103 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ApplyJobDetails|null
     */
    public function getApplyJobDetails()
    {
        return $this->readOneof(103);
    }

    public function hasApplyJobDetails()
    {
        return $this->hasOneof(103);
    }

    /**
     * Output only. Apply job details.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails apply_job_details = 103 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ApplyJobDetails $var
     * @return $this
     */
    public function setApplyJobDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudDms\V1\BackgroundJobLogEntry\ApplyJobDetails::class);
        $this->writeOneof(103, $var);

        return $this;
    }

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

}

