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

namespace Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;

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

/**
 * Reference to a linked resource tracked by this Subscription.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource</code>
 */
class LinkedResource extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Listing for which linked resource is created.
     *
     * Generated from protobuf field <code>string listing = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $listing = '';
    protected $reference;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $linked_dataset
     *           Output only. Name of the linked dataset, e.g.
     *           projects/subscriberproject/datasets/linked_dataset
     *     @type string $linked_pubsub_subscription
     *           Output only. Name of the Pub/Sub subscription, e.g.
     *           projects/subscriberproject/subscriptions/subscriptions/sub_id
     *     @type string $listing
     *           Output only. Listing for which linked resource is created.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Name of the linked dataset, e.g.
     * projects/subscriberproject/datasets/linked_dataset
     *
     * Generated from protobuf field <code>string linked_dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getLinkedDataset()
    {
        return $this->readOneof(1);
    }

    public function hasLinkedDataset()
    {
        return $this->hasOneof(1);
    }

    /**
     * Output only. Name of the linked dataset, e.g.
     * projects/subscriberproject/datasets/linked_dataset
     *
     * Generated from protobuf field <code>string linked_dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setLinkedDataset($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Output only. Name of the Pub/Sub subscription, e.g.
     * projects/subscriberproject/subscriptions/subscriptions/sub_id
     *
     * Generated from protobuf field <code>string linked_pubsub_subscription = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getLinkedPubsubSubscription()
    {
        return $this->readOneof(3);
    }

    public function hasLinkedPubsubSubscription()
    {
        return $this->hasOneof(3);
    }

    /**
     * Output only. Name of the Pub/Sub subscription, e.g.
     * projects/subscriberproject/subscriptions/subscriptions/sub_id
     *
     * Generated from protobuf field <code>string linked_pubsub_subscription = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setLinkedPubsubSubscription($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Output only. Listing for which linked resource is created.
     *
     * Generated from protobuf field <code>string listing = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getListing()
    {
        return $this->listing;
    }

    /**
     * Output only. Listing for which linked resource is created.
     *
     * Generated from protobuf field <code>string listing = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setListing($var)
    {
        GPBUtil::checkString($var, True);
        $this->listing = $var;

        return $this;
    }

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

}

