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

namespace Google\Ads\GoogleAds\V20\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.v20.services.TrendInsight</code>
 */
class TrendInsight extends \Google\Protobuf\Internal\Message
{
    /**
     * The attribute this trend is for.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.AudienceInsightsAttributeMetadata trend_attribute = 1;</code>
     */
    protected $trend_attribute = null;
    /**
     * Metrics associated with this trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.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.v20.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     */
    protected $trend = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V20\Common\AudienceInsightsAttributeMetadata $trend_attribute
     *           The attribute this trend is for.
     *     @type \Google\Ads\GoogleAds\V20\Services\TrendInsightMetrics $trend_metrics
     *           Metrics associated with this trend.
     *     @type int $trend
     *           The direction of trend (such as RISING or DECLINING).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Services\ContentCreatorInsightsService::initOnce();
        parent::__construct($data);
    }

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

        return $this;
    }

    /**
     * Metrics associated with this trend.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.TrendInsightMetrics trend_metrics = 2;</code>
     * @return \Google\Ads\GoogleAds\V20\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.v20.services.TrendInsightMetrics trend_metrics = 2;</code>
     * @param \Google\Ads\GoogleAds\V20\Services\TrendInsightMetrics $var
     * @return $this
     */
    public function setTrendMetrics($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\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.v20.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.v20.enums.InsightsTrendEnum.InsightsTrend trend = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setTrend($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V20\Enums\InsightsTrendEnum\InsightsTrend::class);
        $this->trend = $var;

        return $this;
    }

}

