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

namespace Google\Cloud\DataCatalog\Lineage\V1;

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

/**
 * A lineage event represents an operation on assets. Within the operation, the
 * data flows from the source to the target defined in the links field.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.lineage.v1.LineageEvent</code>
 */
class LineageEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the lineage event.
     * Format:
     * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`.
     * Can be specified or auto-assigned.
     * {lineage_event} must be not longer than 200 characters and only
     * contain characters in a set: `a-zA-Z0-9_-:.`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $name = '';
    /**
     * Optional. List of source-target pairs. Can't contain more than 100 tuples.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $links;
    /**
     * Optional. The beginning of the transformation which resulted in this
     * lineage event. For streaming scenarios, it should be the beginning of the
     * period from which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $start_time = null;
    /**
     * Optional. The end of the transformation which resulted in this lineage
     * event.  For streaming scenarios, it should be the end of the period from
     * which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $end_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Immutable. The resource name of the lineage event.
     *           Format:
     *           `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`.
     *           Can be specified or auto-assigned.
     *           {lineage_event} must be not longer than 200 characters and only
     *           contain characters in a set: `a-zA-Z0-9_-:.`
     *     @type array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $links
     *           Optional. List of source-target pairs. Can't contain more than 100 tuples.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Optional. The beginning of the transformation which resulted in this
     *           lineage event. For streaming scenarios, it should be the beginning of the
     *           period from which the lineage is being reported.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Optional. The end of the transformation which resulted in this lineage
     *           event.  For streaming scenarios, it should be the end of the period from
     *           which the lineage is being reported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the lineage event.
     * Format:
     * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`.
     * Can be specified or auto-assigned.
     * {lineage_event} must be not longer than 200 characters and only
     * contain characters in a set: `a-zA-Z0-9_-:.`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. The resource name of the lineage event.
     * Format:
     * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`.
     * Can be specified or auto-assigned.
     * {lineage_event} must be not longer than 200 characters and only
     * contain characters in a set: `a-zA-Z0-9_-:.`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. List of source-target pairs. Can't contain more than 100 tuples.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLinks()
    {
        return $this->links;
    }

    /**
     * Optional. List of source-target pairs. Can't contain more than 100 tuples.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLinks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\EventLink::class);
        $this->links = $arr;

        return $this;
    }

    /**
     * Optional. The beginning of the transformation which resulted in this
     * lineage event. For streaming scenarios, it should be the beginning of the
     * period from which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL];</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);
    }

    /**
     * Optional. The beginning of the transformation which resulted in this
     * lineage event. For streaming scenarios, it should be the beginning of the
     * period from which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

    /**
     * Optional. The end of the transformation which resulted in this lineage
     * event.  For streaming scenarios, it should be the end of the period from
     * which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL];</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);
    }

    /**
     * Optional. The end of the transformation which resulted in this lineage
     * event.  For streaming scenarios, it should be the end of the period from
     * which the lineage is being reported.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

}

