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

namespace Google\Ads\AdManager\V1;

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

/**
 * Frequency cap using a label.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.LabelFrequencyCap</code>
 */
class LabelFrequencyCap extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The label to used for frequency capping.
     * Format: "networks/{network_code}/labels/{label_id}"
     *
     * Generated from protobuf field <code>optional string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $label = null;
    /**
     * The frequency cap.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.FrequencyCap frequency_cap = 2;</code>
     */
    protected $frequency_cap = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $label
     *           Required. The label to used for frequency capping.
     *           Format: "networks/{network_code}/labels/{label_id}"
     *     @type \Google\Ads\AdManager\V1\FrequencyCap $frequency_cap
     *           The frequency cap.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\AdUnitMessages::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The label to used for frequency capping.
     * Format: "networks/{network_code}/labels/{label_id}"
     *
     * Generated from protobuf field <code>optional string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getLabel()
    {
        return isset($this->label) ? $this->label : '';
    }

    public function hasLabel()
    {
        return isset($this->label);
    }

    public function clearLabel()
    {
        unset($this->label);
    }

    /**
     * Required. The label to used for frequency capping.
     * Format: "networks/{network_code}/labels/{label_id}"
     *
     * Generated from protobuf field <code>optional string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->label = $var;

        return $this;
    }

    /**
     * The frequency cap.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.FrequencyCap frequency_cap = 2;</code>
     * @return \Google\Ads\AdManager\V1\FrequencyCap|null
     */
    public function getFrequencyCap()
    {
        return $this->frequency_cap;
    }

    public function hasFrequencyCap()
    {
        return isset($this->frequency_cap);
    }

    public function clearFrequencyCap()
    {
        unset($this->frequency_cap);
    }

    /**
     * The frequency cap.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.FrequencyCap frequency_cap = 2;</code>
     * @param \Google\Ads\AdManager\V1\FrequencyCap $var
     * @return $this
     */
    public function setFrequencyCap($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\FrequencyCap::class);
        $this->frequency_cap = $var;

        return $this;
    }

}

