<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/admanager/v1/targeting.proto

namespace Google\Ads\AdManager\V1;

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

/**
 * Specifies an ad unit and (optionally) its descendants.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.AdUnitTargeting</code>
 */
class AdUnitTargeting extends \Google\Protobuf\Internal\Message
{
    /**
     * Whether this ad unit's children should be targeted/excluded as well.
     *
     * Generated from protobuf field <code>optional bool include_descendants = 1;</code>
     */
    protected $include_descendants = null;
    /**
     * Optional. The resource name of this ad unit.
     *
     * Generated from protobuf field <code>optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $ad_unit = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $include_descendants
     *           Whether this ad unit's children should be targeted/excluded as well.
     *     @type string $ad_unit
     *           Optional. The resource name of this ad unit.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\Targeting::initOnce();
        parent::__construct($data);
    }

    /**
     * Whether this ad unit's children should be targeted/excluded as well.
     *
     * Generated from protobuf field <code>optional bool include_descendants = 1;</code>
     * @return bool
     */
    public function getIncludeDescendants()
    {
        return isset($this->include_descendants) ? $this->include_descendants : false;
    }

    public function hasIncludeDescendants()
    {
        return isset($this->include_descendants);
    }

    public function clearIncludeDescendants()
    {
        unset($this->include_descendants);
    }

    /**
     * Whether this ad unit's children should be targeted/excluded as well.
     *
     * Generated from protobuf field <code>optional bool include_descendants = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setIncludeDescendants($var)
    {
        GPBUtil::checkBool($var);
        $this->include_descendants = $var;

        return $this;
    }

    /**
     * Optional. The resource name of this ad unit.
     *
     * Generated from protobuf field <code>optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getAdUnit()
    {
        return isset($this->ad_unit) ? $this->ad_unit : '';
    }

    public function hasAdUnit()
    {
        return isset($this->ad_unit);
    }

    public function clearAdUnit()
    {
        unset($this->ad_unit);
    }

    /**
     * Optional. The resource name of this ad unit.
     *
     * Generated from protobuf field <code>optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setAdUnit($var)
    {
        GPBUtil::checkString($var, True);
        $this->ad_unit = $var;

        return $this;
    }

}

