<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * 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. These metrics are for the latest
     * available month and the comparison period is 3 months.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.services.TrendInsightMetrics trend_metrics = 2;</code>
     */
    protected $trend_metrics = null;
    /**
     * Indicate if a trend is sustained or emerging. Use
     * trend_metrics.trend_change_percent to determine the direction of the
     * trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     */
    protected $trend = 0;
    /**
     * 3 years of historical data for the trend, including the most recent month
     * the TrendInsight represents. Each data point represents 1 month of data and
     * the comparison period is 1 month. The data points are ordered from most
     * recent month to least recent month. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.TrendInsightDataPoint trend_data_points = 6;</code>
     */
    private $trend_data_points;
    /**
     * 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. These metrics are for the latest
     *           available month and the comparison period is 3 months.
     * @type int $trend
     *           Indicate if a trend is sustained or emerging. Use
     *           trend_metrics.trend_change_percent to determine the direction of the
     *           trend.
     * @type \Google\Ads\GoogleAds\V23\Services\TrendInsightDataPoint[] $trend_data_points
     *           3 years of historical data for the trend, including the most recent month
     *           the TrendInsight represents. Each data point represents 1 month of data and
     *           the comparison period is 1 month. The data points are ordered from most
     *           recent month to least recent month. Only populated for trends using
     *           search_topics.
     * @type \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata[] $related_videos
     *           Related videos for this topic. Only populated for trends using
     *           search_topics.
     * @type \Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights[] $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. These metrics are for the latest
     * available month and the comparison period is 3 months.
     *
     * 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. These metrics are for the latest
     * available month and the comparison period is 3 months.
     *
     * 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;
    }

    /**
     * Indicate if a trend is sustained or emerging. Use
     * trend_metrics.trend_change_percent to determine the direction of the
     * trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     *
     * @return int
     */
    public function getTrend()
    {
        return $this->trend;
    }

    /**
     * Indicate if a trend is sustained or emerging. Use
     * trend_metrics.trend_change_percent to determine the direction of the
     * trend.
     *
     * 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;
    }

    /**
     * 3 years of historical data for the trend, including the most recent month
     * the TrendInsight represents. Each data point represents 1 month of data and
     * the comparison period is 1 month. The data points are ordered from most
     * recent month to least recent month. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.TrendInsightDataPoint trend_data_points = 6;</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V23\Services\TrendInsightDataPoint>
     */
    public function getTrendDataPoints()
    {
        return $this->trend_data_points;
    }

    /**
     * 3 years of historical data for the trend, including the most recent month
     * the TrendInsight represents. Each data point represents 1 month of data and
     * the comparison period is 1 month. The data points are ordered from most
     * recent month to least recent month. Only populated for trends using
     * search_topics.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.TrendInsightDataPoint trend_data_points = 6;</code>
     *
     * @param  \Google\Ads\GoogleAds\V23\Services\TrendInsightDataPoint[] $var
     * @return $this
     */
    public function setTrendDataPoints($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Services\TrendInsightDataPoint::class);
        $this->trend_data_points = $arr;

        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 RepeatedField<\Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata>
     */
    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  \Google\Ads\GoogleAds\V23\Common\AudienceInsightsAttributeMetadata[] $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 RepeatedField<\Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights>
     */
    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  \Google\Ads\GoogleAds\V23\Services\YouTubeCreatorInsights[] $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;
    }

}

