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

namespace Google\Ads\GoogleAds\V11\Services;

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

/**
 * An audience attribute that can be used to request insights about the
 * audience.
 *
 * Generated from protobuf message <code>google.ads.googleads.v11.services.AudienceInsightsAttribute</code>
 */
class AudienceInsightsAttribute extends \Google\Protobuf\Internal\Message
{
    protected $attribute;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V11\Common\AgeRangeInfo $age_range
     *           An audience attribute defined by an age range.
     *     @type \Google\Ads\GoogleAds\V11\Common\GenderInfo $gender
     *           An audience attribute defined by a gender.
     *     @type \Google\Ads\GoogleAds\V11\Common\LocationInfo $location
     *           An audience attribute defiend by a geographic location.
     *     @type \Google\Ads\GoogleAds\V11\Common\UserInterestInfo $user_interest
     *           An Affinity or In-Market audience.
     *     @type \Google\Ads\GoogleAds\V11\Services\AudienceInsightsEntity $entity
     *           An audience attribute defined by interest in a topic represented by a
     *           Knowledge Graph entity.
     *     @type \Google\Ads\GoogleAds\V11\Services\AudienceInsightsCategory $category
     *           An audience attribute defined by interest in a Product & Service
     *           category.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V11\Services\AudienceInsightsService::initOnce();
        parent::__construct($data);
    }

    /**
     * An audience attribute defined by an age range.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.AgeRangeInfo age_range = 1;</code>
     * @return \Google\Ads\GoogleAds\V11\Common\AgeRangeInfo|null
     */
    public function getAgeRange()
    {
        return $this->readOneof(1);
    }

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

    /**
     * An audience attribute defined by an age range.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.AgeRangeInfo age_range = 1;</code>
     * @param \Google\Ads\GoogleAds\V11\Common\AgeRangeInfo $var
     * @return $this
     */
    public function setAgeRange($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Common\AgeRangeInfo::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * An audience attribute defined by a gender.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.GenderInfo gender = 2;</code>
     * @return \Google\Ads\GoogleAds\V11\Common\GenderInfo|null
     */
    public function getGender()
    {
        return $this->readOneof(2);
    }

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

    /**
     * An audience attribute defined by a gender.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.GenderInfo gender = 2;</code>
     * @param \Google\Ads\GoogleAds\V11\Common\GenderInfo $var
     * @return $this
     */
    public function setGender($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Common\GenderInfo::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * An audience attribute defiend by a geographic location.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.LocationInfo location = 3;</code>
     * @return \Google\Ads\GoogleAds\V11\Common\LocationInfo|null
     */
    public function getLocation()
    {
        return $this->readOneof(3);
    }

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

    /**
     * An audience attribute defiend by a geographic location.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.LocationInfo location = 3;</code>
     * @param \Google\Ads\GoogleAds\V11\Common\LocationInfo $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Common\LocationInfo::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * An Affinity or In-Market audience.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.UserInterestInfo user_interest = 4;</code>
     * @return \Google\Ads\GoogleAds\V11\Common\UserInterestInfo|null
     */
    public function getUserInterest()
    {
        return $this->readOneof(4);
    }

    public function hasUserInterest()
    {
        return $this->hasOneof(4);
    }

    /**
     * An Affinity or In-Market audience.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.common.UserInterestInfo user_interest = 4;</code>
     * @param \Google\Ads\GoogleAds\V11\Common\UserInterestInfo $var
     * @return $this
     */
    public function setUserInterest($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Common\UserInterestInfo::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * An audience attribute defined by interest in a topic represented by a
     * Knowledge Graph entity.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.services.AudienceInsightsEntity entity = 5;</code>
     * @return \Google\Ads\GoogleAds\V11\Services\AudienceInsightsEntity|null
     */
    public function getEntity()
    {
        return $this->readOneof(5);
    }

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

    /**
     * An audience attribute defined by interest in a topic represented by a
     * Knowledge Graph entity.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.services.AudienceInsightsEntity entity = 5;</code>
     * @param \Google\Ads\GoogleAds\V11\Services\AudienceInsightsEntity $var
     * @return $this
     */
    public function setEntity($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Services\AudienceInsightsEntity::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * An audience attribute defined by interest in a Product & Service
     * category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.services.AudienceInsightsCategory category = 6;</code>
     * @return \Google\Ads\GoogleAds\V11\Services\AudienceInsightsCategory|null
     */
    public function getCategory()
    {
        return $this->readOneof(6);
    }

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

    /**
     * An audience attribute defined by interest in a Product & Service
     * category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v11.services.AudienceInsightsCategory category = 6;</code>
     * @param \Google\Ads\GoogleAds\V11\Services\AudienceInsightsCategory $var
     * @return $this
     */
    public function setCategory($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V11\Services\AudienceInsightsCategory::class);
        $this->writeOneof(6, $var);

        return $this;
    }

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

}

