<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/common/targeting_setting.proto

namespace Google\Ads\GoogleAds\V24\Common;

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

/**
 * Settings for the targeting-related features, at the campaign and ad group
 * levels. For more details about the targeting setting, visit
 * https://support.google.com/google-ads/answer/7365594
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.common.TargetingSetting</code>
 */
class TargetingSetting extends \Google\Protobuf\Internal\Message
{
    /**
     * The per-targeting-dimension setting to restrict the reach of your campaign
     * or ad group.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestriction target_restrictions = 1;</code>
     */
    private $target_restrictions;
    /**
     * The list of operations changing the target restrictions.
     * Adding a target restriction with a targeting dimension that already exists
     * causes the existing target restriction to be replaced with the new value.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestrictionOperation target_restriction_operations = 2;</code>
     */
    private $target_restriction_operations;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type \Google\Ads\GoogleAds\V24\Common\TargetRestriction[] $target_restrictions
     *           The per-targeting-dimension setting to restrict the reach of your campaign
     *           or ad group.
     * @type \Google\Ads\GoogleAds\V24\Common\TargetRestrictionOperation[] $target_restriction_operations
     *           The list of operations changing the target restrictions.
     *           Adding a target restriction with a targeting dimension that already exists
     *           causes the existing target restriction to be replaced with the new value.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Common\TargetingSetting::initOnce();
        parent::__construct($data);
    }

    /**
     * The per-targeting-dimension setting to restrict the reach of your campaign
     * or ad group.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestriction target_restrictions = 1;</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V24\Common\TargetRestriction>
     */
    public function getTargetRestrictions()
    {
        return $this->target_restrictions;
    }

    /**
     * The per-targeting-dimension setting to restrict the reach of your campaign
     * or ad group.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestriction target_restrictions = 1;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\TargetRestriction[] $var
     * @return $this
     */
    public function setTargetRestrictions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V24\Common\TargetRestriction::class);
        $this->target_restrictions = $arr;

        return $this;
    }

    /**
     * The list of operations changing the target restrictions.
     * Adding a target restriction with a targeting dimension that already exists
     * causes the existing target restriction to be replaced with the new value.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestrictionOperation target_restriction_operations = 2;</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V24\Common\TargetRestrictionOperation>
     */
    public function getTargetRestrictionOperations()
    {
        return $this->target_restriction_operations;
    }

    /**
     * The list of operations changing the target restrictions.
     * Adding a target restriction with a targeting dimension that already exists
     * causes the existing target restriction to be replaced with the new value.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v24.common.TargetRestrictionOperation target_restriction_operations = 2;</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\TargetRestrictionOperation[] $var
     * @return $this
     */
    public function setTargetRestrictionOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V24\Common\TargetRestrictionOperation::class);
        $this->target_restriction_operations = $arr;

        return $this;
    }

}

