<?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;

/**
 * Represents targeting for custom key/values. The values are ORed together.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.CustomTargetingLiteral</code>
 */
class CustomTargetingLiteral extends \Google\Protobuf\Internal\Message
{
    /**
     * Whether this expression is negatively targeted, meaning it matches
     * ad requests that exclude the below values.
     *
     * Generated from protobuf field <code>optional bool negative = 1;</code>
     */
    protected $negative = null;
    /**
     * Optional. The resource name of the targeted CustomKey.
     *
     * Generated from protobuf field <code>optional string custom_targeting_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $custom_targeting_key = null;
    /**
     * Optional. The resource names of the targeted CustomValues.
     *
     * Generated from protobuf field <code>repeated string custom_targeting_values = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    private $custom_targeting_values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $negative
     *           Whether this expression is negatively targeted, meaning it matches
     *           ad requests that exclude the below values.
     *     @type string $custom_targeting_key
     *           Optional. The resource name of the targeted CustomKey.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $custom_targeting_values
     *           Optional. The resource names of the targeted CustomValues.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\Targeting::initOnce();
        parent::__construct($data);
    }

    /**
     * Whether this expression is negatively targeted, meaning it matches
     * ad requests that exclude the below values.
     *
     * Generated from protobuf field <code>optional bool negative = 1;</code>
     * @return bool
     */
    public function getNegative()
    {
        return isset($this->negative) ? $this->negative : false;
    }

    public function hasNegative()
    {
        return isset($this->negative);
    }

    public function clearNegative()
    {
        unset($this->negative);
    }

    /**
     * Whether this expression is negatively targeted, meaning it matches
     * ad requests that exclude the below values.
     *
     * Generated from protobuf field <code>optional bool negative = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setNegative($var)
    {
        GPBUtil::checkBool($var);
        $this->negative = $var;

        return $this;
    }

    /**
     * Optional. The resource name of the targeted CustomKey.
     *
     * Generated from protobuf field <code>optional string custom_targeting_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getCustomTargetingKey()
    {
        return isset($this->custom_targeting_key) ? $this->custom_targeting_key : '';
    }

    public function hasCustomTargetingKey()
    {
        return isset($this->custom_targeting_key);
    }

    public function clearCustomTargetingKey()
    {
        unset($this->custom_targeting_key);
    }

    /**
     * Optional. The resource name of the targeted CustomKey.
     *
     * Generated from protobuf field <code>optional string custom_targeting_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setCustomTargetingKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->custom_targeting_key = $var;

        return $this;
    }

    /**
     * Optional. The resource names of the targeted CustomValues.
     *
     * Generated from protobuf field <code>repeated string custom_targeting_values = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCustomTargetingValues()
    {
        return $this->custom_targeting_values;
    }

    /**
     * Optional. The resource names of the targeted CustomValues.
     *
     * Generated from protobuf field <code>repeated string custom_targeting_values = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCustomTargetingValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->custom_targeting_values = $arr;

        return $this;
    }

}

