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

namespace Google\Ads\GoogleAds\V23\Services;

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

/**
 * A trend insight for a given attribute.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.services.TrendInsight</code>
 */
class TrendInsight extends \Google\Protobuf\Internal\Message
{
    /**
     * The attribute this trend is for.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata trend_attribute = 1;</code>
     */
    protected $trend_attribute = null;
    /**
     * Metrics associated with this trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.TrendInsightMetrics trend_metrics = 2;</code>
     */
    protected $trend_metrics = null;
    /**
     * The direction of trend (such as RISING or DECLINING).
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     */
    protected $trend = 0;
    /**
     * Related videos for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata related_videos = 4;</code>
     */
    private $related_videos;
    /**
     * Related creators for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.YouTubeCreatorInsights related_creators = 5;</code>
     */
    private $related_creators;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata $trend_attribute
     *           The attribute this trend is for.
     *     @type \Google\Ads\GoogleAds\V23\Services\TrendInsightMetrics $trend_metrics
     *           Metrics associated with this trend.
     *     @type int $trend
     *           The direction of trend (such as RISING or DECLINING).
     *     @type array<\Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata>|\Google\Protobuf\Internal\RepeatedField $related_videos
     *           Related videos for this topic. Only populated for trends using
     *           search_topics.
     *     @type array<\Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights>|\Google\Protobuf\Internal\RepeatedField $related_creators
     *           Related creators for this topic. Only populated for trends using
     *           search_topics.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Services\ContentCreatorInsightsService::initOnce();
        parent::__construct($data);
    }

    /**
     * The attribute this trend is for.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata trend_attribute = 1;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata|null
     */
    public function getTrendAttribute()
    {
        return $this->trend_attribute;
    }

    public function hasTrendAttribute()
    {
        return isset($this->trend_attribute);
    }

    public function clearTrendAttribute()
    {
        unset($this->trend_attribute);
    }

    /**
     * The attribute this trend is for.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata trend_attribute = 1;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata $var
     * @return $this
     */
    public function setTrendAttribute($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata::class);
        $this->trend_attribute = $var;

        return $this;
    }

    /**
     * Metrics associated with this trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.TrendInsightMetrics trend_metrics = 2;</code>
     * @return \Google\Ads\GoogleAds\V23\Services\TrendInsightMetrics|null
     */
    public function getTrendMetrics()
    {
        return $this->trend_metrics;
    }

    public function hasTrendMetrics()
    {
        return isset($this->trend_metrics);
    }

    public function clearTrendMetrics()
    {
        unset($this->trend_metrics);
    }

    /**
     * Metrics associated with this trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.TrendInsightMetrics trend_metrics = 2;</code>
     * @param \Google\Ads\GoogleAds\V23\Services\TrendInsightMetrics $var
     * @return $this
     */
    public function setTrendMetrics($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Services\TrendInsightMetrics::class);
        $this->trend_metrics = $var;

        return $this;
    }

    /**
     * The direction of trend (such as RISING or DECLINING).
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     * @return int
     */
    public function getTrend()
    {
        return $this->trend;
    }

    /**
     * The direction of trend (such as RISING or DECLINING).
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setTrend($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\InsightsTrendEnum\InsightsTrend::class);
        $this->trend = $var;

        return $this;
    }

    /**
     * Related videos for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata related_videos = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRelatedVideos()
    {
        return $this->related_videos;
    }

    /**
     * Related videos for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AudienceInsightsAttributeMetadata related_videos = 4;</code>
     * @param array<\Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRelatedVideos($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata::class);
        $this->related_videos = $arr;

        return $this;
    }

    /**
     * Related creators for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.YouTubeCreatorInsights related_creators = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRelatedCreators()
    {
        return $this->related_creators;
    }

    /**
     * Related creators for this topic. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.YouTubeCreatorInsights related_creators = 5;</code>
     * @param array<\Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRelatedCreators($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights::class);
        $this->related_creators = $arr;

        return $this;
    }

}

