<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v16/services/audience_insights_service.proto

namespace Google\Ads\GoogleAds\V16\Services;

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

/**
 * An entity or category representing a topic that defines an audience.
 *
 * Generated from protobuf message <code>google.ads.googleads.v16.services.AudienceInsightsTopic</code>
 */
class AudienceInsightsTopic extends \Google\Protobuf\Internal\Message
{
    protected $topic;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V16\Services\AudienceInsightsEntity $entity
     *           A Knowledge Graph entity
     *     @type \Google\Ads\GoogleAds\V16\Services\AudienceInsightsCategory $category
     *           A Product & Service category
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V16\Services\AudienceInsightsService::initOnce();
        parent::__construct($data);
    }

    /**
     * A Knowledge Graph entity
     *
     * Generated from protobuf field <code>.google.ads.googleads.v16.services.AudienceInsightsEntity entity = 1;</code>
     * @return \Google\Ads\GoogleAds\V16\Services\AudienceInsightsEntity|null
     */
    public function getEntity()
    {
        return $this->readOneof(1);
    }

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

    /**
     * A Knowledge Graph entity
     *
     * Generated from protobuf field <code>.google.ads.googleads.v16.services.AudienceInsightsEntity entity = 1;</code>
     * @param \Google\Ads\GoogleAds\V16\Services\AudienceInsightsEntity $var
     * @return $this
     */
    public function setEntity($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V16\Services\AudienceInsightsEntity::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A Product & Service category
     *
     * Generated from protobuf field <code>.google.ads.googleads.v16.services.AudienceInsightsCategory category = 2;</code>
     * @return \Google\Ads\GoogleAds\V16\Services\AudienceInsightsCategory|null
     */
    public function getCategory()
    {
        return $this->readOneof(2);
    }

    public function hasCategory()
    {
        return $this->hasOneof(2);
    }

    /**
     * A Product & Service category
     *
     * Generated from protobuf field <code>.google.ads.googleads.v16.services.AudienceInsightsCategory category = 2;</code>
     * @param \Google\Ads\GoogleAds\V16\Services\AudienceInsightsCategory $var
     * @return $this
     */
    public function setCategory($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V16\Services\AudienceInsightsCategory::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

