<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v20/services/audience_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 structured definition of the audience of interest for which insights are
 * being requested in AudienceInsightsService.
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.services.InsightsAudienceDefinition</code>
 */
class InsightsAudienceDefinition extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The audience of interest for which insights are being requested.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience audience = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $audience = null;
    /**
     * Optional. The baseline audience. The default, if unspecified, is all people
     * in the same country as the audience of interest.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience baseline_audience = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $baseline_audience = null;
    /**
     * Optional. The one-month range of historical data to use for insights, in
     * the format "yyyy-mm". If unset, insights will be returned for the last
     * thirty days of data.
     *
     * Generated from protobuf field <code>string data_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $data_month = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V20\Services\InsightsAudience $audience
     *           Required. The audience of interest for which insights are being requested.
     *     @type \Google\Ads\GoogleAds\V20\Services\InsightsAudience $baseline_audience
     *           Optional. The baseline audience. The default, if unspecified, is all people
     *           in the same country as the audience of interest.
     *     @type string $data_month
     *           Optional. The one-month range of historical data to use for insights, in
     *           the format "yyyy-mm". If unset, insights will be returned for the last
     *           thirty days of data.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Services\AudienceInsightsService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The audience of interest for which insights are being requested.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience audience = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Ads\GoogleAds\V20\Services\InsightsAudience|null
     */
    public function getAudience()
    {
        return $this->audience;
    }

    public function hasAudience()
    {
        return isset($this->audience);
    }

    public function clearAudience()
    {
        unset($this->audience);
    }

    /**
     * Required. The audience of interest for which insights are being requested.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience audience = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\GoogleAds\V20\Services\InsightsAudience $var
     * @return $this
     */
    public function setAudience($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Services\InsightsAudience::class);
        $this->audience = $var;

        return $this;
    }

    /**
     * Optional. The baseline audience. The default, if unspecified, is all people
     * in the same country as the audience of interest.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience baseline_audience = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Ads\GoogleAds\V20\Services\InsightsAudience|null
     */
    public function getBaselineAudience()
    {
        return $this->baseline_audience;
    }

    public function hasBaselineAudience()
    {
        return isset($this->baseline_audience);
    }

    public function clearBaselineAudience()
    {
        unset($this->baseline_audience);
    }

    /**
     * Optional. The baseline audience. The default, if unspecified, is all people
     * in the same country as the audience of interest.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.InsightsAudience baseline_audience = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Ads\GoogleAds\V20\Services\InsightsAudience $var
     * @return $this
     */
    public function setBaselineAudience($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Services\InsightsAudience::class);
        $this->baseline_audience = $var;

        return $this;
    }

    /**
     * Optional. The one-month range of historical data to use for insights, in
     * the format "yyyy-mm". If unset, insights will be returned for the last
     * thirty days of data.
     *
     * Generated from protobuf field <code>string data_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDataMonth()
    {
        return $this->data_month;
    }

    /**
     * Optional. The one-month range of historical data to use for insights, in
     * the format "yyyy-mm". If unset, insights will be returned for the last
     * thirty days of data.
     *
     * Generated from protobuf field <code>string data_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDataMonth($var)
    {
        GPBUtil::checkString($var, True);
        $this->data_month = $var;

        return $this;
    }

}

