<?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 between source and target entities.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.lineage.v1.EventLink</code>
 */
class EventLink extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Reference to the source entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $source = null;
    /**
     * Required. Reference to the target entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $target = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source
     *           Required. Reference to the source entity
     *     @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target
     *           Required. Reference to the target entity
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Reference to the source entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED];</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);
    }

    /**
     * Required. Reference to the source entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED];</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;
    }

    /**
     * Required. Reference to the target entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED];</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);
    }

    /**
     * Required. Reference to the target entity
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED];</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;
    }

}

