<?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;

/**
 * Links represent the data flow between **source** (upstream)
 * and **target** (downstream) assets in transformation pipelines.
 * Links are created when LineageEvents record data transformation between
 * related assets.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.lineage.v1.Link</code>
 */
class Link extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Immutable. The name of the link. Format:
     * `projects/{project}/locations/{location}/links/{link}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $name = '';
    /**
     * The pointer to the entity that is the **source** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 2;</code>
     */
    protected $source = null;
    /**
     * The pointer to the entity that is the **target** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 3;</code>
     */
    protected $target = null;
    /**
     * The start of the first event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 4;</code>
     */
    protected $start_time = null;
    /**
     * The end of the last event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 5;</code>
     */
    protected $end_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Immutable. The name of the link. Format:
     *           `projects/{project}/locations/{location}/links/{link}`.
     *     @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source
     *           The pointer to the entity that is the **source** of this link.
     *     @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target
     *           The pointer to the entity that is the **target** of this link.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The start of the first event establishing this link.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The end of the last event establishing this link.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Immutable. The name of the link. Format:
     * `projects/{project}/locations/{location}/links/{link}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Immutable. The name of the link. Format:
     * `projects/{project}/locations/{location}/links/{link}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The pointer to the entity that is the **source** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 2;</code>
     * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null
     */
    public function getSource()
    {
        return $this->source;
    }

    public function hasSource()
    {
        return isset($this->source);
    }

    public function clearSource()
    {
        unset($this->source);
    }

    /**
     * The pointer to the entity that is the **source** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 2;</code>
     * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class);
        $this->source = $var;

        return $this;
    }

    /**
     * The pointer to the entity that is the **target** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 3;</code>
     * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null
     */
    public function getTarget()
    {
        return $this->target;
    }

    public function hasTarget()
    {
        return isset($this->target);
    }

    public function clearTarget()
    {
        unset($this->target);
    }

    /**
     * The pointer to the entity that is the **target** of this link.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 3;</code>
     * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class);
        $this->target = $var;

        return $this;
    }

    /**
     * The start of the first event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 4;</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 start of the first event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 4;</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 end of the last event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 5;</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 end of the last event establishing this link.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 5;</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;
    }

}

