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

namespace Google\Cloud\Datastream\V1;

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

/**
 * Represents a backfill job on a specific stream object.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.BackfillJob</code>
 */
class BackfillJob extends \Google\Protobuf\Internal\Message
{
    /**
     * Backfill job state.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.State state = 1;</code>
     */
    private $state = 0;
    /**
     * Backfill job's triggering reason.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.Trigger trigger = 2;</code>
     */
    private $trigger = 0;
    /**
     * Output only. Backfill job's start time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $last_start_time = null;
    /**
     * Output only. Backfill job's end time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $last_end_time = null;
    /**
     * Output only. Errors which caused the backfill job to fail.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.Error errors = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $errors;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $state
     *           Backfill job state.
     *     @type int $trigger
     *           Backfill job's triggering reason.
     *     @type \Google\Protobuf\Timestamp $last_start_time
     *           Output only. Backfill job's start time.
     *     @type \Google\Protobuf\Timestamp $last_end_time
     *           Output only. Backfill job's end time.
     *     @type array<\Google\Cloud\Datastream\V1\Error>|\Google\Protobuf\Internal\RepeatedField $errors
     *           Output only. Errors which caused the backfill job to fail.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Backfill job state.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.State state = 1;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Backfill job state.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.State state = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Datastream\V1\BackfillJob\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Backfill job's triggering reason.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.Trigger trigger = 2;</code>
     * @return int
     */
    public function getTrigger()
    {
        return $this->trigger;
    }

    /**
     * Backfill job's triggering reason.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BackfillJob.Trigger trigger = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setTrigger($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Datastream\V1\BackfillJob\Trigger::class);
        $this->trigger = $var;

        return $this;
    }

    /**
     * Output only. Backfill job's start time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastStartTime()
    {
        return $this->last_start_time;
    }

    public function hasLastStartTime()
    {
        return isset($this->last_start_time);
    }

    public function clearLastStartTime()
    {
        unset($this->last_start_time);
    }

    /**
     * Output only. Backfill job's start time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_start_time = $var;

        return $this;
    }

    /**
     * Output only. Backfill job's end time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastEndTime()
    {
        return $this->last_end_time;
    }

    public function hasLastEndTime()
    {
        return isset($this->last_end_time);
    }

    public function clearLastEndTime()
    {
        unset($this->last_end_time);
    }

    /**
     * Output only. Backfill job's end time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_end_time = $var;

        return $this;
    }

    /**
     * Output only. Errors which caused the backfill job to fail.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.Error errors = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrors()
    {
        return $this->errors;
    }

    /**
     * Output only. Errors which caused the backfill job to fail.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.Error errors = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\Datastream\V1\Error>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastream\V1\Error::class);
        $this->errors = $arr;

        return $this;
    }

}

