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

namespace Google\Cloud\Asset\V1;

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

/**
 * A Pub/Sub destination.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.PubsubDestination</code>
 */
class PubsubDestination extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the Pub/Sub topic to publish to.
     * Example: `projects/PROJECT_ID/topics/TOPIC_ID`.
     *
     * Generated from protobuf field <code>string topic = 1;</code>
     */
    private $topic = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $topic
     *           The name of the Pub/Sub topic to publish to.
     *           Example: `projects/PROJECT_ID/topics/TOPIC_ID`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the Pub/Sub topic to publish to.
     * Example: `projects/PROJECT_ID/topics/TOPIC_ID`.
     *
     * Generated from protobuf field <code>string topic = 1;</code>
     * @return string
     */
    public function getTopic()
    {
        return $this->topic;
    }

    /**
     * The name of the Pub/Sub topic to publish to.
     * Example: `projects/PROJECT_ID/topics/TOPIC_ID`.
     *
     * Generated from protobuf field <code>string topic = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setTopic($var)
    {
        GPBUtil::checkString($var, True);
        $this->topic = $var;

        return $this;
    }

}

